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

# End a call

> Either Contact ends the Call. A ringing Call ends canceled when its caller ends it and no-answer when its recipient does; an answered Call ends completed. A participant may also send `end` over its authenticated Call room. Cleanup remains available after a block or removal. Repeated terminal actions never restart the Call.



## OpenAPI

````yaml /api-reference/openapi.mint.yaml post /v1/calls/{callId}/end
openapi: 3.1.0
info:
  title: Relay API
  version: 1.0.0
  description: >-
    Create conversations between users and agents.


    Send multipart Messages, manage Chats, upload Attachments, and receive agent
    events.
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
servers:
  - url: https://api.staging.relayapp.im
    description: Relay API
security:
  - BearerAuth: []
tags:
  - name: Agents
    x-page-title: Agents
    description: >-
      Read who owns the authenticated agent, manage who is always and never
      allowed to message it, manage its OAuth2 client for Log in with Relay, and
      delete existing developer-managed agents.
  - name: Chats
    x-page-title: Chats
    description: Create, retrieve, and update direct or group chats.
  - name: Messages
    x-page-title: Messages
    description: Send and retrieve messages, replies, reactions, and receipts.
  - name: Attachments
    x-page-title: Attachments
    description: Allocate, upload, retrieve, and delete attachment bytes.
  - name: Blocked Handles
    x-page-title: Blocked Handles
    description: |-
      Block or unblock registered Relay Handles. In a direct Chat, a block in
      either direction means a Message is stored for the sender and never
      delivered to the other party, silently. In a group Chat, blocking is one
      way: you do not receive Messages from a Handle you blocked, but that
      Handle still receives yours, and every other member receives as normal.
      Blocking does not delete existing Chats or history.
  - name: Contact Card
    x-page-title: Contact Card
    description: Manage the authenticated agent's Relay contact card.
  - name: Webhooks
    x-page-title: Webhooks
    description: Register signed webhook destinations.
  - name: WebSocket
    description: Receive agent events over a durable acknowledged WebSocket.
  - name: Contacts
    description: Request a user Contact.
  - name: Directory
    description: Find public agents by category or task. No credential is needed.
  - name: Payments
    x-page-title: Payments
    description: Ask a person to pay, on your organization's own connected Stripe account.
  - name: Calls
    description: >-
      Start, answer, end and read individual user-agent audio calls. Call events
      use Relay's normal agent event delivery, and both Contacts join the
      authenticated Call room as WebRTC audio participants.
paths:
  /v1/calls/{callId}/end:
    post:
      tags:
        - Calls
      summary: End a call
      description: >-
        Either Contact ends the Call. A ringing Call ends canceled when its
        caller ends it and no-answer when its recipient does; an answered Call
        ends completed. A participant may also send `end` over its authenticated
        Call room. Cleanup remains available after a block or removal. Repeated
        terminal actions never restart the Call.
      operationId: endCall
      parameters:
        - name: callId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CallEmptyRequest'
      responses:
        '200':
          description: Operation completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
components:
  schemas:
    CallEmptyRequest:
      type: object
      additionalProperties: false
      required: []
      properties: {}
    CallResult:
      type: object
      additionalProperties: false
      required:
        - call
      properties:
        call:
          $ref: '#/components/schemas/Call'
    Call:
      type: object
      additionalProperties: false
      required:
        - id
        - chat_id
        - from
        - to
        - status
        - revision
        - created_at
        - ringing_at
        - answered_at
        - ended_at
      properties:
        id:
          type: string
          format: uuid
        chat_id:
          type: string
          format: uuid
        from:
          $ref: '#/components/schemas/CallContact'
        to:
          type: array
          minItems: 1
          maxItems: 1
          items:
            $ref: '#/components/schemas/CallContact'
        status:
          type: string
          description: >-
            `ringing` and `in-progress` are live. `completed`, `no-answer`,
            `canceled`, `busy` and `failed` are terminal and set `ended_at`.
          enum:
            - ringing
            - in-progress
            - completed
            - no-answer
            - canceled
            - busy
            - failed
        revision:
          type: integer
          minimum: 1
        created_at:
          type: string
          format: date-time
        ringing_at:
          type: string
          format: date-time
        answered_at:
          type:
            - string
            - 'null'
          format: date-time
        ended_at:
          type:
            - string
            - 'null'
          format: date-time
    ErrorResponse:
      type: object
      required:
        - error
        - success
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
        success:
          type: boolean
          description: Always false for error responses
        trace_id:
          type: string
          description: Unique trace ID for request tracing and debugging
    CallContact:
      type: object
      additionalProperties: false
      required:
        - id
        - handle
        - kind
      properties:
        id:
          type: string
          format: uuid
        handle:
          type: string
          minLength: 1
        kind:
          type: string
          enum:
            - user
            - agent
        timezone:
          type:
            - string
            - 'null'
          maxLength: 64
          examples:
            - America/Detroit
          description: >-
            The person's IANA time zone name, as their Relay app last reported
            it; null until the app reports one. When the person uses Relay on
            more than one device, the device they used last sets it. Present
            only when kind is user. Timestamps stay in UTC; use this to read
            them in the person's local time.
        age_range:
          type:
            - string
            - 'null'
          enum:
            - under_13
            - 13_15
            - 16_17
            - 18_plus
            - null
          examples:
            - 18_plus
          description: >-
            The person's age range, as their Relay app last reported it: from
            Apple's Declared Age Range, or from a birth year the person gave
            once (only the range is kept). Null until the app reports one.
            Present only when kind is user. A person whose range is not 18_plus
            never reaches an agent rated 18_plus, so an agent never needs to ask
            anyone their age.
        links:
          type: array
          maxItems: 5
          uniqueItems: true
          items:
            type: string
            format: uri
            maxLength: 2048
            pattern: ^https://
          examples:
            - - https://github.com/ana
              - https://www.instagram.com/ana
          description: >-
            The person's profile links, as they set them in Relay: at most 5
            absolute https URLs, in the order they chose, each stored as the
            WHATWG URL parser normalises it (scheme and host lowercased, a
            non-ASCII host as punycode) and different from the others after
            normalising. Relay refuses control characters and whitespace,
            userinfo, hosts that are not public (localhost, IP literals,
            single-label names, .local and other private names), and a host
            label that mixes Latin with another script. Empty when they set
            none. Present only when kind is user. Relay sends no platform name;
            read the site from the URL.
        about:
          type:
            - string
            - 'null'
          maxLength: 160
          examples:
            - Builds robots in Ann Arbor.
          description: >-
            The person's about, as they wrote it in Relay: plain text, at most
            160 characters, with no control characters. Null when they wrote
            none. Present only when kind is user.
        rive:
          description: >-
            The Rive file this agent shows in its calls, so the app can load it
            before the call connects. Null when it has none. Present only when
            kind is agent.
          anyOf:
            - $ref: '#/components/schemas/RiveFile'
            - type: 'null'
    ErrorDetail:
      type: object
      required:
        - status
        - code
        - message
        - doc_url
      properties:
        status:
          type: integer
          description: HTTP status code (e.g., 400, 404, 500)
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: Human-readable error message
        doc_url:
          type: string
          description: Link to documentation for this error code
        retry_after:
          type: integer
          description: >-
            Number of seconds to wait before retrying. Only present on 429 rate
            limit errors.
    RiveFile:
      type: object
      additionalProperties: false
      required:
        - file
        - artboard
        - state_machine
        - view_model
      description: >-
        A Rive file an agent shows in its calls: a character, a quiz, a game, a
        chart. The app draws `artboard` and runs `state_machine`, binding
        `view_model`; the agent drives it live on the call's `rive` data
        channel. Names are Rive's own; a null name means the file's default.
      properties:
        file:
          type: string
          format: uri
          description: >-
            The .riv Relay hosts, at a permanent address that never changes its
            bytes: `<cdn>/rive/<contact id>/<version>/file-<hash>.riv`.
          examples:
            - >-
              https://cdn.relayapp.im/rive/0199a000-0000-7000-8000-00000000000b/1790000000000/file-0123456789abcdef.riv
        artboard:
          type:
            - string
            - 'null'
          maxLength: 255
          examples:
            - Call
        state_machine:
          type:
            - string
            - 'null'
          maxLength: 255
          examples:
            - Main
        view_model:
          type:
            - string
            - 'null'
          maxLength: 255
          examples:
            - Main
    ErrorCode:
      type: integer
      description: Relay API error code.
  responses:
    BadRequest:
      description: Invalid request - validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized - missing or invalid authentication
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Forbidden - no access to this resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Conflict:
      description: The request conflicts with the current state of the resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >
        Bearer token authentication. Include your API token in the Authorization
        header.


        Format: `Authorization: Bearer <your-token>`

````

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