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

# Update contact card

> Update the authenticated agent's Contact Card.



## OpenAPI

````yaml /api-reference/openapi.mint.yaml patch /v1/contact_card
openapi: 3.1.0
info:
  title: Relay API
  version: 1.0.0
  description: >-
    Create conversations between users and agents.


    Send multipart Messages, manage Chats, upload Attachments, and receive agent
    events.
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
servers:
  - url: https://api.relayapp.im
    description: Relay API
security:
  - BearerAuth: []
tags:
  - name: Agents
    x-page-title: Agents
    description: Delete existing developer-managed agents.
  - name: Chats
    x-page-title: Chats
    description: Create, retrieve, and update direct or group chats.
  - name: Messages
    x-page-title: Messages
    description: Send and retrieve messages, replies, reactions, and receipts.
  - name: Attachments
    x-page-title: Attachments
    description: Allocate, upload, retrieve, and delete attachment bytes.
  - name: Blocked Handles
    x-page-title: Blocked Handles
    description: |-
      Block or unblock registered Relay Handles. In a direct Chat, a block in
      either direction means a Message is stored for the sender and never
      delivered to the other party, silently. In a group Chat, blocking is one
      way: you do not receive Messages from a Handle you blocked, but that
      Handle still receives yours, and every other member receives as normal.
      Blocking does not delete existing Chats or history.
  - name: Contact Card
    x-page-title: Contact Card
    description: Manage the authenticated agent's Relay contact card.
  - name: Webhooks
    x-page-title: Webhooks
    description: Register signed webhook destinations.
  - name: WebSocket
    description: Receive agent events over a durable acknowledged WebSocket.
  - name: Contacts
    description: Request a user Contact.
paths:
  /v1/contact_card:
    patch:
      tags:
        - Contact Card
      summary: Update contact card
      description: Update the authenticated agent's Contact Card.
      operationId: updateContactCard
      parameters:
        - name: handle
          in: query
          required: true
          description: Relay Handle. Agents can access only their own card.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateContactCardRequest'
      responses:
        '200':
          description: Contact card updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetContactCardResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
components:
  schemas:
    UpdateContactCardRequest:
      type: object
      additionalProperties: false
      not:
        required:
          - image_url
          - attachment_id
      dependentSchemas:
        image_recipe:
          anyOf:
            - required:
                - attachment_id
            - required:
                - image_url
              properties:
                image_url:
                  type: string
      properties:
        about:
          type: string
          minLength: 1
          maxLength: 60
          description: About text. Surrounding whitespace is trimmed.
        first_name:
          type: string
          minLength: 1
          maxLength: 30
          description: >-
            Updated first name, at most 30 characters. If omitted, the existing
            value is kept.
        last_name:
          type:
            - string
            - 'null'
          description: Updated last name. If omitted, the existing value is kept.
        image_url:
          type:
            - string
            - 'null'
          description: >-
            Updated profile image. Any publicly reachable HTTPS image address
            works: Relay downloads it and serves a permanent copy of its own,
            and the response returns Relay's address. If omitted, the existing
            image is kept.
          format: uri
        attachment_id:
          type: string
          format: uuid
          description: >-
            This agent's completed image upload from the Attachments API. Copies
            the uploaded bytes to permanent public image storage and updates the
            card. Mutually exclusive with image_url, including null. Omit both
            to keep the existing image.
        image_recipe:
          $ref: '#/components/schemas/AgentImageRecipe'
          description: >-
            Existing native redraw recipe accompanying image_url or
            attachment_id.
    SetContactCardResponse:
      type: object
      required:
        - handle
        - first_name
        - is_active
        - kind
        - last_name
        - image_url
        - image_color
      properties:
        first_name:
          type: string
          description: First name on the contact card
        last_name:
          type:
            - string
            - 'null'
        image_url:
          type:
            - string
            - 'null'
          format: uri
        image_color:
          type:
            - string
            - 'null'
          pattern: ^[0-9A-F]{6}$
          description: >-
            Dominant colour of the picture at image_url, six uppercase hex
            digits, computed by Relay once when the picture is set. Null when
            Relay could not read the picture.
        is_active:
          type: boolean
          description: Whether the contact card was successfully applied to the device
        handle:
          type: string
          description: Relay Handle associated with this contact card.
        kind:
          type: string
          enum:
            - user
            - agent
          description: Whether the Contact is a user or an agent.
    AgentImageRecipe:
      oneOf:
        - $ref: '#/components/schemas/AgentMonogramImageRecipe'
        - $ref: '#/components/schemas/AgentEmojiImageRecipe'
        - $ref: '#/components/schemas/AgentPhotoImageRecipe'
    ErrorResponse:
      type: object
      required:
        - error
        - success
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
        success:
          type: boolean
          description: Always false for error responses
        trace_id:
          type: string
          description: Unique trace ID for request tracing and debugging
    AgentMonogramImageRecipe:
      type: object
      additionalProperties: false
      required:
        - recipe
        - background
      properties:
        recipe:
          type: object
          additionalProperties: false
          required:
            - monogram
          properties:
            monogram:
              type: object
              additionalProperties: false
              required:
                - initials
              properties:
                initials:
                  type: string
                  minLength: 1
                  description: >-
                    One to four graphemes without spaces, at most 16 UTF-8
                    bytes.
        background:
          $ref: '#/components/schemas/AgentImageBackground'
    AgentEmojiImageRecipe:
      type: object
      additionalProperties: false
      required:
        - recipe
        - background
      properties:
        recipe:
          type: object
          additionalProperties: false
          required:
            - emoji
          properties:
            emoji:
              type: object
              additionalProperties: false
              required:
                - emoji
              properties:
                emoji:
                  type: string
                  description: >-
                    Exactly one emoji, validated by Relay's existing
                    image-recipe parser.
        background:
          $ref: '#/components/schemas/AgentImageBackground'
    AgentPhotoImageRecipe:
      type: object
      additionalProperties: false
      required:
        - recipe
      properties:
        recipe:
          type: object
          additionalProperties: false
          required:
            - image
          properties:
            image:
              type: object
              additionalProperties: false
    ErrorDetail:
      type: object
      required:
        - status
        - code
        - message
        - doc_url
      properties:
        status:
          type: integer
          description: HTTP status code (e.g., 400, 404, 500)
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: Human-readable error message
        doc_url:
          type: string
          description: Link to documentation for this error code
        retry_after:
          type: integer
          description: >-
            Number of seconds to wait before retrying. Only present on 429 rate
            limit errors.
    AgentImageBackground:
      type: object
      additionalProperties: false
      required:
        - linearGradient
      properties:
        linearGradient:
          type: object
          additionalProperties: false
          required:
            - colors
          properties:
            colors:
              type: array
              minItems: 2
              maxItems: 2
              items:
                type: string
              description: One existing Relay gradient pair, ordered top then base.
              enum:
                - - EC8A3C
                  - C85F1C
                - - E0567A
                  - AD2A52
                - - D05FC6
                  - 93217E
                - - 8F6CF2
                  - 5F38CF
                - - 5B9BFA
                  - 0B52C0
                - - 2596A6
                  - 116A79
                - - 2FA46A
                  - '137347'
    ErrorCode:
      type: integer
      description: Relay API error code.
  responses:
    BadRequest:
      description: Invalid request - validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized - missing or invalid authentication
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Forbidden - no access to this resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >
        Bearer token authentication. Include your API token in the Authorization
        header.


        Format: `Authorization: Bearer <your-token>`

````