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

# Create contact



## OpenAPI

````yaml /openapi/contact.json post /contacts
openapi: 3.0.3
info:
  title: Beem Contacts API
  version: 1.4.0
  description: >-
    The Beem Contacts API allows developers to manage address books and contacts
    for messaging workflows.
  contact:
    name: Beem
    url: https://beem.africa
    email: support@beem.africa
servers:
  - url: https://api-contact.beem.africa/public/v1
    description: Production server
  - url: https://dev-contact.beem.africa/public/v1
    description: Staging server
security: []
tags: []
paths:
  /contacts:
    post:
      summary: Create contact
      operationId: createContact
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                first_name:
                  description: Contact first name.
                  nullable: true
                  type: string
                last_name:
                  description: Contact last name.
                  nullable: true
                  type: string
                title:
                  description: Salutation or title (e.g. Mr, Ms).
                  nullable: true
                  type: string
                gender:
                  description: Contact gender.
                  nullable: true
                  type: string
                mob_no2:
                  description: Secondary mobile number.
                  nullable: true
                email:
                  description: Contact email address.
                  nullable: true
                  type: string
                  format: email
                  pattern: \s*[,]\s*
                address_country:
                  description: Country of residence.
                  nullable: true
                  type: string
                address_city:
                  description: City of residence.
                  nullable: true
                  type: string
                address_area:
                  description: Area or district.
                  nullable: true
                  type: string
                dob:
                  description: Date of birth.
                  nullable: true
                  type: string
                mob_no:
                  description: Primary mobile number (digits only, with country code).
                  anyOf:
                    - type: string
                    - type: number
                      format: float
                addressbook_id:
                  description: One or more address book IDs to add this contact to.
                  type: array
                  items:
                    type: string
              additionalProperties: false
              required:
                - mob_no
                - addressbook_id
            examples:
              createContact:
                summary: Create contact
                value:
                  first_name: John
                  last_name: Doe
                  mob_no: '255700000001'
                  mob_no2: '255700000002'
                  email: john.doe@example.com
                  gender: male
                  title: Mr.
                  addressbook_id:
                    - 604919718fb019194453764e
                  address_country: Tanzania
                  address_city: Dar es Salaam
                  address_area: Kijitonyama
                  dob: '1990-01-01'
      responses:
        '200':
          description: Contact created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        description: Unique ID of the affected contact.
                        example: '1234567890'
                        type: string
                      message:
                        description: Human-readable status message.
                        example: Contact created successfully
                        type: string
                      status:
                        description: Operation status code or message.
                        example: 'true'
                        anyOf:
                          - type: string
                          - type: number
                            format: float
                    additionalProperties: false
                    required:
                      - message
                      - status
                additionalProperties: false
                required:
                  - data
              examples:
                contactCreated:
                  summary: Contact created
                  value:
                    data:
                      id: 60e99589eeadc6338b16cb42
                      message: Contact added successfully
                      status: 'true'
        '400':
          description: Bad request — invalid mobile number format.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    description: HTTP status code.
                    example: 400
                    type: integer
                  message:
                    description: Error message.
                    example: Invalid Mobile Number
                    type: string
                additionalProperties: false
                required:
                  - status
                  - message
              examples:
                invalidMobileNumber:
                  summary: Invalid mobile number
                  value:
                    status: 400
                    message: Invalid Mobile Number
        '401':
          description: Unauthorized — invalid or missing API credentials.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: API error code.
                    example: 120
                  message:
                    type: string
                    description: Error message.
                    example: Invalid Authorization Parameters
                required:
                  - code
                  - message
                additionalProperties: false
              examples:
                invalidAuthorization:
                  summary: Invalid authorization
                  value:
                    code: 120
                    message: Invalid Authorization Parameters
        '404':
          description: Not found — the address book does not exist.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      message:
                        description: Human-readable status message.
                        example: Addressbook Not Found
                        type: string
                      status:
                        description: Operation status.
                        example: 'false'
                        type: string
                    additionalProperties: false
                    required:
                      - message
                      - status
                additionalProperties: false
                required:
                  - data
              examples:
                addressbookNotFound:
                  summary: Addressbook not found
                  value:
                    data:
                      message: Addressbook Not Found
                      status: 'false'
        '409':
          description: Conflict — the contact already exists in the address book.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      message:
                        description: Human-readable status message.
                        example: Contact already exists
                        type: string
                      status:
                        description: Operation status.
                        example: 'false'
                        type: string
                    additionalProperties: false
                    required:
                      - message
                      - status
                additionalProperties: false
                required:
                  - data
              examples:
                contactAlreadyExists:
                  summary: Contact already exists
                  value:
                    data:
                      message: Contact already exists
                      status: 'false'
        default:
          description: Unexpected error.
      security:
        - basicAuth: []
        - accessToken: []
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: 'Beem API credentials: API key as username, API secret as password.'
    accessToken:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Access token only. Send as Authorization: <token> — do not use a Bearer
        prefix.

````