> ## Documentation Index
> Fetch the complete documentation index at: https://docs.postsyncer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a webhook

> Get one webhook endpoint, with its last 7 days of deliveries.

> [!NOTE]
>
> Needs `webhooks:read`. Every role in the workspace can read it. See [Permissions](https://docs.postsyncer.com/essentials/authentication.md#permissions).

Gives the endpoint when it is in a workspace the key can reach. The signing secret is never in it, and `url` is cut to the scheme and host (`url_masked: true`) when your role can't edit the endpoint.

* `stats_7d` counts the deliveries of today and the six days before, oldest first. A delivery that gave up counts as failed.
* `failing_since` is when its deliveries started failing; `null` while they work.
* After 3 days of failing PostSyncer turns it off: `active` is `false`, `disabled_reason` says why, and the person who set it up is told, or the workspace owner if that person is no longer in the workspace. [Update a webhook](https://docs.postsyncer.com/api-reference/webhooks/update.md) with `"active": true` turns it on again.

[List webhook deliveries](https://docs.postsyncer.com/api-reference/webhooks/deliveries.md) has each request sent and what your server answered.

## Errors

| Status | `error` | When | Retry? |
| - | - | - | - |
| 401 | | No API key, or not a valid one. | No: fix the key. |
| 403 | | The key lacks `webhooks:read`, or its user is inactive. | No: grant it in Settings → API. |
| 404 | | No webhook with that id in the workspaces the key can reach. | No. |
| 429 | | More than 60 requests a minute. | Yes, after `Retry-After` seconds. |

## Related

* [List webhooks](https://docs.postsyncer.com/api-reference/webhooks/list.md): every endpoint.
* [Update a webhook](https://docs.postsyncer.com/api-reference/webhooks/update.md): change it, or turn it on again.


## OpenAPI

````yaml GET /webhooks/{id}
openapi: 3.0.3
info:
  title: PostSyncer API
  description: >-
    Post to 12 social networks from your code: posts, media, comments,
    analytics, webhooks and more.
  version: 1.0.0
servers:
  - url: https://postsyncer.com/api/v1
security:
  - bearerAuth: []
tags:
  - name: Workspaces
    description: The workspaces the key can reach.
  - name: Accounts
    description: Connected social accounts, links to connect more, and disconnecting them.
  - name: Posts
    description: Drafts, scheduled and published posts, approvals and a post's history.
  - name: Post settings
    description: A post's auto-plug, comment moderation and contact collection.
  - name: Media
    description: >-
      The media library: file uploads, URL imports, and reading videos and
      social posts' files.
  - name: Folders
    description: Folders that organise the media library.
  - name: Comments
    description: >-
      Comments on your posts: reading, replying, editing, hiding, deleting and
      syncing them.
  - name: Reviews
    description: Google Business Profile reviews and your replies to them.
  - name: Analytics
    description: Workspace, account and post performance.
  - name: Brand
    description: >-
      A workspace's brand: identity, voice, look, accounts, competitors,
      learnings and rules.
  - name: Labels
    description: Labels used to tag posts.
  - name: Campaigns
    description: Campaigns used to group posts.
  - name: Snippets
    description: Saved snippets and hashtag groups to drop into posts.
  - name: Webhooks
    description: Signed webhook endpoints that get your notification events.
paths:
  /webhooks/{id}:
    get:
      tags:
        - Webhooks
      summary: Get a webhook
      description: >-
        Needs `webhooks:read`. Gives one webhook endpoint of a workspace the key
        can reach, with its last 7 days of deliveries. Every role in the
        workspace can read it. The signing secret is never in it. Webhooks work
        on every plan, Free included.
      operationId: getWebhook
      parameters:
        - name: id
          in: path
          required: true
          description: The webhook's id.
          schema:
            type: integer
      responses:
        '200':
          description: The webhook.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
              examples:
                default:
                  summary: An endpoint
                  value:
                    id: 42
                    workspace_id: 12
                    kind: webhook
                    name: Failed posts to our CRM
                    url: https://hooks.haldencoffee.com/postsyncer
                    url_masked: false
                    secret_last4: 0aCe
                    events:
                      - post.failed
                      - post.account_failed
                    account_ids: null
                    workspace_ids: null
                    active: true
                    failing_since: null
                    disabled_reason: null
                    created_at: '2030-03-08T09:00:00+00:00'
                    updated_at: '2030-03-08T09:00:00+00:00'
                    stats_7d:
                      sent: 5
                      failed: 1
                      daily:
                        - date: '2030-03-09'
                          sent: 0
                          failed: 0
                        - date: '2030-03-10'
                          sent: 1
                          failed: 0
                        - date: '2030-03-11'
                          sent: 0
                          failed: 0
                        - date: '2030-03-12'
                          sent: 2
                          failed: 0
                        - date: '2030-03-13'
                          sent: 0
                          failed: 0
                        - date: '2030-03-14'
                          sent: 1
                          failed: 1
                        - date: '2030-03-15'
                          sent: 1
                          failed: 0
                    last_delivery_at: '2030-03-15T09:00:02+00:00'
                turned_off:
                  summary: Turned off after 3 days failing
                  value:
                    id: 43
                    workspace_id: 12
                    kind: webhook
                    name: Published posts to the shop
                    url: https://shop.haldencoffee.com/hooks/postsyncer
                    url_masked: false
                    secret_last4: Qm2x
                    events:
                      - post.published
                    account_ids: null
                    workspace_ids: null
                    active: false
                    failing_since: '2030-03-10T06:15:00+00:00'
                    disabled_reason: It has been failing for 3 days.
                    created_at: '2030-02-20T11:30:00+00:00'
                    updated_at: '2030-03-13T06:20:00+00:00'
                    stats_7d:
                      sent: 0
                      failed: 9
                      daily:
                        - date: '2030-03-09'
                          sent: 0
                          failed: 0
                        - date: '2030-03-10'
                          sent: 0
                          failed: 3
                        - date: '2030-03-11'
                          sent: 0
                          failed: 2
                        - date: '2030-03-12'
                          sent: 0
                          failed: 3
                        - date: '2030-03-13'
                          sent: 0
                          failed: 1
                        - date: '2030-03-14'
                          sent: 0
                          failed: 0
                        - date: '2030-03-15'
                          sent: 0
                          failed: 0
                    last_delivery_at: '2030-03-13T06:20:00+00:00'
        '401':
          $ref: '#/components/responses/Unauthorized401'
        '403':
          description: The key lacks `webhooks:read`, or its user is inactive.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missing_permission:
                  summary: The key lacks webhooks:read
                  value:
                    message: >-
                      This API key does not have the "webhooks:read" permission.
                      Edit the key in PostSyncer under Settings → API to grant
                      it.
                inactive_account:
                  summary: The key's user is inactive
                  value:
                    message: Your account is inactive.
        '404':
          $ref: '#/components/responses/NotFound404'
        '429':
          $ref: '#/components/responses/RateLimited429'
components:
  schemas:
    Webhook:
      type: object
      description: A signed webhook endpoint.
      required:
        - id
        - workspace_id
        - kind
        - name
        - url
        - url_masked
        - secret_last4
        - events
        - account_ids
        - workspace_ids
        - active
        - failing_since
        - disabled_reason
        - created_at
        - updated_at
        - stats_7d
        - last_delivery_at
      properties:
        id:
          type: integer
        workspace_id:
          type: integer
          description: The workspace it belongs to.
        kind:
          type: string
          enum:
            - webhook
        name:
          type: string
          maxLength: 100
        url:
          type: string
          description: >-
            Where the events go. In full when your role lets you edit the
            endpoint; otherwise the scheme and host alone, like
            `https://hooks.haldencoffee.com/…`.
        url_masked:
          type: boolean
          description: True when `url` is cut to the scheme and host.
        secret:
          type: string
          description: >-
            Only in the answer to Create a webhook: the signing secret in full,
            `whsec_` and 32 characters.
        secret_last4:
          type: string
          description: The secret's last four characters, to tell secrets apart.
        events:
          type: array
          items:
            type: string
            enum:
              - post.published
              - post.partially_published
              - post.failed
              - post.account_published
              - post.account_failed
              - post.scheduled
              - post.deleted
              - post.needs_media
              - posts.bulk_removed
              - approval.requested
              - approval.approved
              - approval.rejected
              - account.needs_reconnect
              - account.expires_soon
              - account.paused
              - account.connected
              - account.disconnected
              - account.posts_to_put_back
              - comment.mentioned
              - comment.received
              - share.comment_received
              - review.received
              - media.generated
              - media.generation_failed
              - brand.learned
              - team.member_joined
              - webhook.test
        account_ids:
          type: array
          nullable: true
          items:
            type: integer
          description: Only events about these accounts; null for every account.
        workspace_ids:
          type: array
          nullable: true
          items:
            oneOf:
              - type: integer
              - type: string
                enum:
                  - '*'
          description: >-
            The other workspaces it gets events from, as numbers (an id sent as
            a string of digits comes back as a number), or `["*"]` for every
            workspace the owner has; null for its own workspace alone.
        active:
          type: boolean
          description: 'False when it is turned off: nothing is sent to it.'
        failing_since:
          type: string
          format: date-time
          nullable: true
          description: >-
            When its deliveries started failing; null while they work. After 3
            days failing it is turned off.
        disabled_reason:
          type: string
          nullable: true
          description: >-
            Why PostSyncer turned it off, like `It has been failing for 3
            days.`; null otherwise.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        stats_7d:
          type: object
          description: >-
            Deliveries over the last 7 days: today and the six days before,
            oldest first. A delivery that gave up counts as failed.
          required:
            - sent
            - failed
            - daily
          properties:
            sent:
              type: integer
            failed:
              type: integer
            daily:
              type: array
              items:
                type: object
                required:
                  - date
                  - sent
                  - failed
                properties:
                  date:
                    type: string
                    format: date
                  sent:
                    type: integer
                  failed:
                    type: integer
        last_delivery_at:
          type: string
          format: date-time
          nullable: true
          description: When the latest delivery was made; null before the first.
    Error:
      type: object
      description: >-
        An error answer. Every one has `message`, in plain words; some add an
        `error` code and fields of their own.
      required:
        - message
      properties:
        message:
          type: string
          description: What went wrong and what to do about it.
  responses:
    Unauthorized401:
      description: No API key, or not a valid one.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            unauthenticated:
              summary: No valid API key
              value:
                message: Unauthenticated.
    NotFound404:
      description: Nothing with that id in the workspaces the key can reach.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            not_found:
              summary: Not found
              value:
                message: Not found.
    RateLimited429:
      description: >-
        More than 60 requests in a minute from this key's user (the API and the
        MCP server share the count). Wait `Retry-After` seconds.
      headers:
        Retry-After:
          description: Seconds until requests are allowed again.
          schema:
            type: integer
        X-RateLimit-Limit:
          description: Requests allowed a minute.
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Requests left this minute.
          schema:
            type: integer
        X-RateLimit-Reset:
          description: When requests are allowed again, as a Unix timestamp.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            too_many_attempts:
              summary: Too many requests
              value:
                message: Too Many Attempts.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.