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

> ## Agent Instructions
> Postploy's MCP server for posting is https://api.postploy.com/mcp and signs in with OAuth. The REST API base URL is https://api.postploy.com/public/v1 and takes an API key as a Bearer token. The API calls channels accounts.

# Add an endpoint

> Adds an endpoint that Postploy calls when the events you pick happen. A team can have up to 10.

The response holds the endpoint's signing `secret`. It's shown only this once, so store it now. You need it to [verify requests](/webhooks/verify).




## OpenAPI

````yaml /openapi.yaml post /webhooks
openapi: 3.1.0
info:
  title: Postploy API
  version: '1'
  description: Schedule and manage social media posts in your Postploy team.
  contact:
    name: Postploy support
    email: support@postploy.com
servers:
  - url: https://api.postploy.com/public/v1
security:
  - apiKey: []
tags:
  - name: Channels
  - name: Posts
  - name: Approvals
  - name: Media
  - name: Trash
  - name: Webhooks
paths:
  /webhooks:
    post:
      tags:
        - Webhooks
      summary: Add an endpoint
      description: >
        Adds an endpoint that Postploy calls when the events you pick happen. A
        team can have up to 10.


        The response holds the endpoint's signing `secret`. It's shown only this
        once, so store it now. You need it to [verify
        requests](/webhooks/verify).
      operationId: createWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
                - events
              additionalProperties: false
              properties:
                url:
                  type: string
                  format: uri
                  maxLength: 2000
                  description: A public `https` URL.
                events:
                  type: array
                  minItems: 1
                  description: The events to send.
                  items:
                    $ref: '#/components/schemas/WebhookEvent'
                description:
                  type: string
                  maxLength: 200
                  description: A note for your team, such as what the endpoint is for.
            example:
              url: https://example.com/postploy/webhooks
              events:
                - post.published
                - post.failed
              description: Posts to our Slack
      responses:
        '201':
          description: The endpoint, with its signing secret.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/WebhookWithSecret'
              example:
                data:
                  id: 9d8c7b6a-5f4e-4d3c-a2b1-0f9e8d7c6b5a
                  url: https://example.com/postploy/webhooks
                  description: Posts to our Slack
                  events:
                    - post.published
                    - post.failed
                  enabled: true
                  disabledReason: null
                  createdAt: '2030-01-10T12:00:00.000Z'
                  secret: whsec_3q2-7wEXAMPLEsecretDoNotUse_Kd9vL0pQ
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    WebhookEvent:
      type: string
      enum:
        - post.scheduled
        - post.pending_approval
        - post.published
        - post.failed
        - account.needs_reconnect
    WebhookWithSecret:
      allOf:
        - $ref: '#/components/schemas/Webhook'
        - type: object
          required:
            - secret
          properties:
            secret:
              type: string
              description: The signing secret, starting with `whsec_`. Shown only once.
    Webhook:
      type: object
      required:
        - id
        - url
        - description
        - events
        - enabled
        - disabledReason
        - createdAt
      properties:
        id:
          type: string
          format: uuid
        url:
          type: string
          format: uri
        description:
          type:
            - string
            - 'null'
        events:
          type: array
          items:
            $ref: '#/components/schemas/WebhookEvent'
        enabled:
          type: boolean
        disabledReason:
          type:
            - string
            - 'null'
          description: >-
            Why Postploy switched the endpoint off, such as 10 failed deliveries
            in a row.
        createdAt:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - statusCode
        - message
        - errors
        - timestamp
        - route
      properties:
        statusCode:
          type: integer
        message:
          type: string
          description: What went wrong, in plain words. Safe to show to people.
        errors:
          type:
            - array
            - 'null'
          description: Every problem, when there's more than one place to look.
          items:
            type: object
            properties:
              message:
                type: string
              path:
                type: array
                description: Where the problem is, such as `["posts", 0, "scheduledAt"]`.
                items:
                  type:
                    - string
                    - integer
              cause:
                type: string
              code:
                type: string
                description: >-
                  On plan limits, `PLATFORM_LIMIT_REACHED` or
                  `TOTAL_LIMIT_REACHED`.
              platform:
                type: string
        timestamp:
          type: string
          format: date-time
        route:
          type: string
  responses:
    BadRequest:
      description: >-
        The request is invalid, or a post breaks its platform's rules. `message`
        gives the first problem, and `errors` lists every one with its `path`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 400
            message: Scheduled date and time must be in the future
            errors:
              - message: Scheduled date and time must be in the future
                path:
                  - posts
                  - 0
                  - scheduledAt
                cause: custom
            timestamp: '2030-01-10T12:00:00.000Z'
            route: /public/v1/posts
    Unauthorized:
      description: The API key is missing, unknown or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 401
            message: Invalid API key
            errors: null
            timestamp: '2030-01-10T12:00:00.000Z'
            route: /public/v1/accounts
    Forbidden:
      description: Your role in the team doesn't allow this.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: >-
        More than 120 requests a minute to this endpoint. All of a person's keys
        count together. Wait the number of seconds in `Retry-After-caller`, then
        try again.
      headers:
        Retry-After-caller:
          description: Seconds to wait before trying again.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        An API key from **Settings › AI apps & API** in Postploy. Keys start
        with `ppk_`.

````

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