> ## 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.

# Select a profile

> Select a profile and obtain a profile-scoped session token.



## OpenAPI

````yaml /openapi/user.yaml post /api/v1/auth/profiles/{profile_id}/select
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/profiles/{profile_id}/select:
    post:
      tags:
        - Profiles
      summary: Select a profile
      description: Select a profile and obtain a profile-scoped session token.
      operationId: profiles_select
      parameters:
        - in: path
          name: profile_id
          schema:
            type: string
            format: uuid
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProfileSelectRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ProfileSelectRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProfileSelectRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfileTokenResponse'
          description: ''
      security:
        - bearerAuth: []
components:
  schemas:
    ProfileSelectRequest:
      type: object
      description: Profile selection ("Who's watching") — PIN required only if locked.
      properties:
        pin:
          type: string
          writeOnly: true
    ProfileTokenResponse:
      type: object
      properties:
        profile_id:
          type: string
          format: uuid
        profile_token:
          type: string
        expires_in:
          type: integer
      required:
        - expires_in
        - profile_id
        - profile_token
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Enter your JWT token in the format: Bearer <token>'

````