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

# Identify a contact

> Associates a visitor or known contact with a set of traits. Use this to create or update a contact record from the browser — for example, after a form submission or login event.

Create or update a contact from the browser (async or sync)



## OpenAPI

````yaml /api-reference/specs/analytics.json post /api/analytics/identify
openapi: 3.1.0
info:
  title: ConveYour API — Analytics
  description: >-
    Identify contacts and track events from your website or app using a
    Client-safe key.
  version: 1.0.0
servers:
  - url: https://{subdomain}.conveyour.com
    description: Your organization's ConveYour instance
    variables:
      subdomain:
        default: acme
        description: >-
          Your organization's slug — the subdomain you sign in on. Replace
          `acme` with yours: if you sign in at `bigco.conveyour.com`, enter
          `bigco`.
security:
  - conveyourToken: []
tags:
  - name: Analytics
    description: >-
      Identify contacts and track events from your website or app using a
      Client-safe key.
paths:
  /api/analytics/identify:
    post:
      tags:
        - Analytics
      summary: Identify a contact
      description: >-
        Associates a visitor or known contact with a set of traits. Use this to
        create or update a contact record from the browser — for example, after
        a form submission or login event.


        Create or update a contact from the browser (async or sync)
      operationId: createOrUpdateAContactFromTheBrowserAsyncOrSync
      parameters:
        - $ref: '#/components/parameters/teams'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - id
              properties:
                id:
                  description: >-
                    The contact identifier — email address, phone number, public
                    portal ID (PID), or internal contact ID.
                  type: string
                traits:
                  description: >-
                    Contact fields to create or update (e.g. `first_name`,
                    `last_name`, `mobile`, any org-defined field). Pass
                    `"$process": 2` inside `traits` for synchronous processing
                    (see response section).
                  type: object
                  additionalProperties: true
            example:
              id: jane@example.com
              traits:
                first_name: Jane
                last_name: Doe
                email: jane@example.com
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        allOf:
                          - $ref: '#/components/schemas/AnalyticsResult'
                        description: >-
                          Empty for a batch (array) payload — that path returns
                          [] with message "queued N". Also empty for a single
                          payload unless traits.$process = 2.
              example:
                status: ok
                message: queued
                data: {}
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  parameters:
    teams:
      name: teams[]
      in: query
      description: >-
        Team scope for the request, as one or more team ObjectIds. The brackets
        are required: PHP keeps only the last value for a repeated plain key, so
        `teams=A&teams=B` silently resolves to B alone. On requests with a JSON
        body you may send `teams` (no brackets) in the body instead.


        **Values that are not valid ObjectIds are silently ignored** — a
        mistyped team ID behaves as if no team was sent. See the [teams section
        of the API conventions guide](/guides/api-conventions#team-scoping).
      style: form
      explode: true
      schema:
        type: array
        items:
          type: string
      example:
        - 64a1b2c3d4e5f6a7b8c9d0ff
  schemas:
    Envelope:
      type: object
      description: The common response envelope shared by all ConveYour endpoints.
      properties:
        status:
          type: string
          enum:
            - ok
            - failed
          description: '`ok` on success, `failed` on error.'
        message:
          type: string
          description: Human-readable description of the result.
        data:
          description: >-
            The response payload — an object or an array depending on the
            endpoint.
    AnalyticsResult:
      type: object
      description: >-
        Identify result. `con_pid` is returned ONLY when a single (non-array)
        payload is sent with `traits.$process = 2`, which processes the identify
        synchronously; the response message is then `processed`. In every other
        case the identify is queued and data is an empty object.
      properties:
        con_pid:
          type: string
          description: >-
            The identified contact's public ID. Present only on synchronous
            processing.
  responses:
    Forbidden:
      description: >-
        The token is missing or invalid, or the service account behind it lacks
        the permission this endpoint requires.
      content:
        application/json:
          example:
            status: failed
            message: Lacking necessary permission add_contacts
            data:
              permission: add_contacts
  securitySchemes:
    conveyourToken:
      type: apiKey
      in: header
      name: x-conveyour-token
      description: >-
        Your API key token. Contacts endpoints require a **Server-only — Full
        API** key — see [Authentication](/quickstart).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.