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

# Complete correspondent registration

> Self-register as a correspondent using a valid invitation token.



## OpenAPI

````yaml /openapi/user.yaml post /api/v1/auth/correspondents/invite/{token}
openapi: 3.0.3
info:
  title: CapeMedia User Service API
  version: 1.0.0
  description: |2-

        **CapeMedia User Service API** - Comprehensive user service and management system.

        ## Authentication
        This API uses **JWT Bearer tokens** for authentication.

        1. Login via `/api/v1/auth/login` to obtain tokens
        2. Include the access token in the `Authorization` header: `Bearer <access_token>`
        3. Refresh expired tokens via `/api/v1/auth/refresh-token`

        ## Versioning
        The API uses URL path versioning (e.g., `/api/v1/`, `/api/v2/`).
        Current version: **v1**
        
  contact:
    name: API Support
    email: support@capemedia.co.ke
  license:
    name: Cape Media
servers:
  - url: https://api.diginacape.co.ke/acl
    description: Production
  - url: http://localhost:8000
    description: Local
security: []
paths:
  /api/v1/auth/correspondents/invite/{token}:
    post:
      tags:
        - Correspondents
      summary: Complete correspondent registration
      description: Self-register as a correspondent using a valid invitation token.
      operationId: correspondents_register
      parameters:
        - in: path
          name: token
          schema:
            type: string
            format: uuid
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CorrespondentRegisterRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CorrespondentRegisterRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CorrespondentRegisterRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CorrespondentUser'
          description: ''
      security:
        - bearerAuth: []
        - {}
components:
  schemas:
    CorrespondentRegisterRequest:
      type: object
      description: Validate the self-registration payload submitted by a correspondent.
      properties:
        first_name:
          type: string
          minLength: 1
          maxLength: 150
        last_name:
          type: string
          minLength: 1
          maxLength: 150
        country_code:
          type: string
          minLength: 1
          maxLength: 3
        phone_number:
          type: string
          minLength: 1
          maxLength: 50
        password:
          type: string
          writeOnly: true
          minLength: 8
      required:
        - country_code
        - first_name
        - last_name
        - password
        - phone_number
    CorrespondentUser:
      type: object
      description: Lightweight serializer for listing correspondent users.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        email:
          type: string
          format: email
          title: Email address
          maxLength: 254
        first_name:
          type: string
          maxLength: 150
        last_name:
          type: string
          maxLength: 150
        name:
          type: string
          readOnly: true
        phone_number:
          type: string
          maxLength: 50
        status:
          type: string
          maxLength: 20
        date_joined:
          type: string
          format: date-time
      required:
        - id
        - name
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Enter your JWT token in the format: Bearer <token>'

````