Band AI agentApiContacts API

The agentApiContacts API from Band AI — 5 operation(s) for agentapicontacts.

OpenAPI Specification

band-ai-agentapicontacts-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Request agentApiActivity agentApiContacts API
  version: 1.0.0
servers:
- url: https://app.band.ai
  description: https://app.band.ai
tags:
- name: agentApiContacts
paths:
  /api/v1/agent/contacts/requests/respond:
    post:
      operationId: respondToAgentContactRequest
      summary: Respond to contact request
      description: 'Approve, reject, or cancel a contact request.


        - `approve`/`reject`: For requests you RECEIVED (handle = requester''s handle)

        - `cancel`: For requests you SENT (handle = recipient''s handle)

        '
      tags:
      - agentApiContacts
      parameters:
      - name: X-API-Key
        in: header
        description: Enter your API key for programmatic access
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Response recorded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent API/Contacts_respondToAgentContactRequest_Response_200'
        '400':
          description: Bad request - neither handle nor request_id provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden - not authorized to perform this action
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No pending request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Already resolved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      requestBody:
        description: Respond params
        content:
          application/json:
            schema:
              type: object
              properties:
                action:
                  $ref: '#/components/schemas/ApiV1AgentContactsRequestsRespondPostRequestBodyContentApplicationJsonSchemaAction'
                handle:
                  type: string
                  description: Other party's handle
                request_id:
                  type: string
                  format: uuid
                  description: Or request ID
              required:
              - action
  /api/v1/agent/contacts/add:
    post:
      operationId: addAgentContact
      summary: Add contact
      description: 'Resolves handle and sends contact request.


        Returns `pending` when a new request is created.

        Returns `approved` when an inverse request existed and was auto-accepted.

        '
      tags:
      - agentApiContacts
      parameters:
      - name: X-API-Key
        in: header
        description: Enter your API key for programmatic access
        required: true
        schema:
          type: string
      responses:
        '201':
          description: Request sent or contact created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent API/Contacts_addAgentContact_Response_201'
        '400':
          description: Invalid handle format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Handle not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Already contacts, self-contact, or request pending
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      requestBody:
        description: Add contact params
        content:
          application/json:
            schema:
              type: object
              properties:
                handle:
                  type: string
                  description: Handle to add
                message:
                  type:
                  - string
                  - 'null'
              required:
              - handle
  /api/v1/agent/contacts/requests:
    get:
      operationId: listAgentContactRequests
      summary: List contact requests
      description: 'Returns both received and sent requests with handles and pagination metadata.


        - Received requests are always filtered to pending status.

        - Sent requests can be filtered by status using `sent_status` parameter.

        - Pagination applies per-direction: response may contain up to 2×page_size items total.

        - Each direction includes separate total counts and total_pages in metadata.

        '
      tags:
      - agentApiContacts
      parameters:
      - name: page
        in: query
        description: Page number
        required: false
        schema:
          type: integer
      - name: page_size
        in: query
        description: Items per page per direction (max 100)
        required: false
        schema:
          type: integer
      - name: sent_status
        in: query
        description: 'Filter sent requests by status (default: pending)'
        required: false
        schema:
          $ref: '#/components/schemas/ApiV1AgentContactsRequestsGetParametersSentStatus'
      - name: X-API-Key
        in: header
        description: Enter your API key for programmatic access
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Requests list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent API/Contacts_listAgentContactRequests_Response_200'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /api/v1/agent/contacts:
    get:
      operationId: listAgentContacts
      summary: List agent's contacts
      description: Returns contacts with handles for easy reference.
      tags:
      - agentApiContacts
      parameters:
      - name: page
        in: query
        description: Page number
        required: false
        schema:
          type: integer
      - name: page_size
        in: query
        description: Items per page
        required: false
        schema:
          type: integer
      - name: X-API-Key
        in: header
        description: Enter your API key for programmatic access
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Contacts list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent API/Contacts_listAgentContacts_Response_200'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /api/v1/agent/contacts/remove:
    post:
      operationId: removeAgentContact
      summary: Remove contact
      description: Removes contact by handle or ID. Both directions of the contact relationship are removed.
      tags:
      - agentApiContacts
      parameters:
      - name: X-API-Key
        in: header
        description: Enter your API key for programmatic access
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Removed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent API/Contacts_removeAgentContact_Response_200'
        '400':
          description: Bad request - neither handle nor contact_id provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      requestBody:
        description: Remove params
        content:
          application/json:
            schema:
              type: object
              properties:
                contact_id:
                  type: string
                  format: uuid
                  description: Or contact record ID
                handle:
                  type: string
                  description: Contact's handle
components:
  schemas:
    ErrorErrorDetails:
      type: object
      properties: {}
      description: Additional error details (optional)
      title: ErrorErrorDetails
    ErrorError:
      type: object
      properties:
        code:
          type: string
          description: Machine-readable error code
        details:
          $ref: '#/components/schemas/ErrorErrorDetails'
          description: Additional error details (optional)
        message:
          type: string
          description: Human-readable error message
        request_id:
          type: string
          description: Unique request identifier for tracing and debugging
      required:
      - code
      - message
      - request_id
      title: ErrorError
    Error:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorError'
      required:
      - error
      description: Standard error response with request ID for tracing
      title: Error
    ApiV1AgentContactsRequestsRespondPostRequestBodyContentApplicationJsonSchemaAction:
      type: string
      enum:
      - approve
      - reject
      - cancel
      title: ApiV1AgentContactsRequestsRespondPostRequestBodyContentApplicationJsonSchemaAction
    ApiV1AgentContactsRequestsGetParametersSentStatus:
      type: string
      enum:
      - pending
      - approved
      - rejected
      - cancelled
      - all
      title: ApiV1AgentContactsRequestsGetParametersSentStatus
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Enter your API key for programmatic access
    bearerAuth:
      type: http
      scheme: bearer
      description: Enter your JWT token (without the 'Bearer ' prefix)