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

# Write user profile data

> Upserts user profile data into the CDP.
Requires either an API key or an Okta JWT bearer token.




## OpenAPI

````yaml /profileapi.yaml post /cdp/v1/users
openapi: 3.0.3
info:
  title: Zeotap Profile API
  description: |
    Zeotap CDP Profile API.

    The api supports two authentication mechanisms (API Key and Okta JWT)
    and exposes profile write, search, and delete operations.
  version: 1.0.0
servers:
  - url: https://api.zeotap.com
security: []
tags:
  - name: Profile
    description: CDP User Profile operations
paths:
  /cdp/v1/users:
    post:
      tags:
        - Profile
      summary: Write user profile data
      description: |
        Upserts user profile data into the CDP.
        Requires either an API key or an Okta JWT bearer token.
      operationId: writeProfile
      parameters:
        - $ref: '#/components/parameters/Scopes'
        - $ref: '#/components/parameters/OrgId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertProfileRequest'
            example:
              orgId: 1234
              region: EU
              ucid: d7a6bc75-2c87-4650-91dc-c212771866c9
              ids:
                email_sha256_lowercase: 0a0601cfc9d014580fcf0b0
              upsert:
                profile:
                  user_gender: M
                mkt_preferences:
                  telemarketing: market
                  sms_optin: 'yes'
                consent:
                  gdpr_advertising: 'yes'
      responses:
        '200':
          description: Profile written successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfileResponseArray'
        '400':
          description: Bad request
        '401':
          description: Unauthorized – invalid or missing credentials
        '403':
          description: Forbidden – insufficient scopes
      security:
        - ApiKeyAuth: []
        - OktaJwt: []
components:
  parameters:
    Scopes:
      name: scopes
      in: header
      required: true
      description: |
        Comma-separated list of granted scopes.
        Allowed values: `profile.read`, `profile.write`, `profile.delete`
      schema:
        type: string
        example: profile.read,profile.write,profile.delete
    OrgId:
      name: orgId
      in: header
      required: false
      description: |
        Zeotap organisation ID. Required when using Okta JWT authentication.
      schema:
        type: integer
        example: 1577
  schemas:
    UpsertProfileRequest:
      type: object
      required:
        - orgId
        - region
        - ids
        - upsert
      properties:
        orgId:
          type: integer
          description: Organisation identifier
          example: 1234
        region:
          type: string
          description: Region code to scope the write
          example: EU
        ucid:
          type: string
          format: uuid
          description: Unified Customer ID (optional; used to target a specific profile)
          example: d7a6bc75-2c87-4650-91dc-c212771866c9
        ids:
          type: object
          additionalProperties:
            type: string
          description: |
            Map of identifier type to a single identifier value
            (e.g. `email_sha256_lowercase`, `AdId`).
          example:
            email_sha256_lowercase: 0a0601cfc9d014580fcf0b0
        upsert:
          type: object
          description: Profile data to upsert
          properties:
            profile:
              type: object
              additionalProperties: true
              description: Arbitrary profile attributes (e.g. demographics, preferences)
            mkt_preferences:
              type: object
              additionalProperties: true
              description: Marketing opt-in / opt-out preferences
            consent:
              type: object
              additionalProperties: true
              description: Consent records
    ProfileResponseArray:
      type: array
      items:
        $ref: '#/components/schemas/ProfileRecord'
    ProfileRecord:
      type: object
      properties:
        updated_ts:
          type: integer
          format: int64
          description: Last-updated epoch timestamp (ms)
        created_ts:
          type: integer
          format: int64
          description: Created epoch timestamp (ms)
        profile:
          type: object
          additionalProperties: true
          description: |
            Nested profile attributes organised by category
            (e.g. Audience, demographics). Structure varies by org config.
        ids:
          $ref: '#/components/schemas/IdentityMap'
        mkt_preferences:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/MarketingPreference'
          description: Marketing opt-in / opt-out preferences
        consent:
          type: object
          additionalProperties: true
          description: Consent records
        region:
          type: string
          description: Region the profile belongs to
          example: UK
        ucid:
          type: string
          format: uuid
          description: Unified Customer ID
          example: 00000000-9295-9295-9295-8db6a1c8e06a
    IdentityMap:
      type: object
      description: |
        Map of identity namespaces to arrays of identity records.
        Each namespace (e.g. `email`, `cellphone`, `ga_clientid`)
        contains an array of identity objects with a timestamp.
      additionalProperties:
        type: array
        items:
          type: object
          additionalProperties: true
          properties:
            _ts:
              type: string
              description: Epoch timestamp (ms) of identity record
      example:
        email:
          - email_sha256_lowercase: af2bdbe...
            _ts: '1639918545133'
        icoms_account_uid:
          - icoms_account_uid: '41063074106'
            _ts: '1639918545133'
        linkedUcid:
          - a1a62720-8788-8788-8788-fb81f77515b1
    MarketingPreference:
      type: object
      properties:
        datasourceId:
          type: string
        datasetId:
          type: string
        type:
          type: string
          description: Preference type identifier
        value:
          type: string
          description: Preference value (e.g. "yes", "no")
        _ts:
          type: string
          description: Epoch timestamp (ms) of last update
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: apikey
      description: Long-lasting client key
    OktaJwt:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Okta-issued JWT passed in the Authorization header

````