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

# Create a Shortext endpoint

> Your server then posts the messages of your users to settings.inbound_url with your API key and `to` = the endpoint id. With a webhook_url, the response holds `webhook_secret` once: keep it to verify the signature of the replies.



## OpenAPI

````yaml /api-reference/v2.0/openapi.json post /channels/shortext
openapi: 3.1.0
info:
  title: Shortext API
  description: >-
    **Versioning**: every version is a frozen contract. A released version only
    receives additive changes

    (new endpoints, new optional fields, new response fields); anything breaking
    ships in a new version.

    Responses carry `X-Shortext-Api-Version`. When a version is scheduled for
    removal, responses also carry

    `Deprecation` and `Sunset` headers; after the sunset date the version
    answers HTTP 410.

    The list of versions and their status is available at `GET /api/versions`.


    **Responses**: always HTTP 200. Check `success` and `code` (`1000` =
    success), see `ApiEnvelope`.

    On failure, `trace_id` identifies the request for support.
  version: '2.0'
servers:
  - url: https://shortext.ny-corp.io/api/v2.0
security: []
tags:
  - name: Agents
    description: Agents
  - name: Channels
    description: Channels
  - name: Conversations
    description: Conversations
  - name: Account
    description: Account
  - name: Templates
    description: Templates
  - name: Hosted sessions
    description: Hosted sessions
  - name: Webhooks
    description: Webhooks
paths:
  /channels/shortext:
    post:
      tags:
        - Channels
      summary: Create a Shortext endpoint
      description: >-
        Your server then posts the messages of your users to
        settings.inbound_url with your API key and `to` = the endpoint id. With
        a webhook_url, the response holds `webhook_secret` once: keep it to
        verify the signature of the replies.
      operationId: createShortextEndpoint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShortextEndpointInput'
      responses:
        '200':
          description: >-
            Always HTTP 200: the outcome is in `success` and `code` (absolute
            value of the response code).
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiEnvelope'
                  - properties:
                      body:
                        allOf:
                          - $ref: '#/components/schemas/Channel'
                          - properties:
                              webhook_secret:
                                description: >-
                                  Signing secret of the replies, only when the
                                  webhook is created or rotated
                                type: string
                            type: object
                    type: object
      security:
        - bearerAuth: []
components:
  schemas:
    ShortextEndpointInput:
      properties:
        name:
          description: Required on creation
          type: string
          maxLength: 255
        agent_id:
          description: Agent answering on the endpoint; null detaches it
          type:
            - string
            - 'null'
          example: AGI-XXXXX
        enabled:
          type: boolean
          default: true
        reply_mode:
          description: >-
            `async`: replies pushed to webhook_url (signed); `sync`: replies in
            the response of the inbound call
          type: string
          default: async
          enum:
            - async
            - sync
        sync_timeout:
          description: Seconds the sync mode waits for the replies
          type: integer
          default: 25
          maximum: 25
          minimum: 1
        webhook_url:
          description: Where the replies are pushed (https); null removes it
          type:
            - string
            - 'null'
      type: object
    ApiEnvelope:
      properties:
        success:
          type: boolean
          example: true
        code:
          type: integer
          example: 1000
        message:
          type: string
          example: Request success.
        body:
          description: Endpoint payload, null when there is none
        token:
          description: Present only on authentication routes
          type:
            - string
            - 'null'
        trace_id:
          description: Present only when success is false
          type:
            - string
            - 'null'
      type: object
    Channel:
      properties:
        type:
          description: >-
            Public representation of a channel (API v2.0 and webhooks). The id
            is the one webhooks use as channel_id.
          type: string
          enum:
            - whatsapp
            - mail
            - shortext
          example: whatsapp
        id:
          description: >-
            Channel id (the channel_id of the webhooks): WhatsApp phone number
            id, mailbox id (mbx_...) or Shortext endpoint id (ste_...)
          type: string
          example: '532867649916076'
        name:
          type: string
          example: +237 6 99 99 99 99 (Acme)
        enabled:
          type: boolean
        agent:
          description: >-
            null when the channel is detached: messages are stored, nobody
            answers automatically
          properties:
            id:
              type: string
              example: AGI-XXXXX
            name:
              type: string
          type:
            - object
            - 'null'
        settings:
          description: 'Shortext only: endpoint settings (null for the other channels)'
          properties:
            client_type:
              type: string
              example: server
            inbound_url:
              description: Where your server posts the messages of your users
              type: string
            reply_mode:
              description: >-
                `async`: replies pushed to webhook_url; `sync`: replies in the
                inbound response
              type: string
              enum:
                - async
                - sync
            sync_timeout:
              description: Seconds the sync mode waits for the replies
              type: integer
            webhook_url:
              type:
                - string
                - 'null'
          type:
            - object
            - 'null'
        created_at:
          type: string
          format: date-time
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        Company API key, sent as `Authorization: Bearer <key>`. Create it in the
        dashboard (Developer > API Keys) with the permissions the integration
        needs.
      scheme: bearer

````

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