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

# Add tags to contacts

> Apply tags to contacts in bulk: every tag in `tagIds` to every contact in `contactIds` (up to 10000 contacts and 50 tags per call; split larger selections). Idempotent: pairs that already exist are skipped. Any contact or tag id outside the workspace (including a company tag id) rejects the whole call with 404 before anything is written. Requires contact and company tags on the workspace: without them every tag endpoint answers 400 with `details.code` `ENTITY_TAGS_NOT_ENABLED`; tell the user instead of retrying.

    > **Required scope:** `CONTACTS_WRITE`
    >
    > **Rate limit:** 30 requests per minute



## OpenAPI

````yaml https://openapi.enginy.ai/definitions.json post /v1/contacts/tags/add
openapi: 3.1.0
info:
  title: Enginy API
  version: 1.0.0
  description: Public API for Enginy platform
servers:
  - url: https://openapi.enginy.ai
    description: Configured server
security: []
tags:
  - name: AI Variables
    description: >-
      Manage AI variables and discover the entity fields you can reference in
      prompts and entity requests.
  - name: Inbox
    description: >-
      Inbox endpoints for listing contact threads, reading thread messages,
      managing tags, and sending manual replies.
  - name: Workflows
    description: >-
      Build, validate, publish, run, and inspect advanced (graph) workflows,
      plus the block/condition catalog needed to author a workflow plan.
paths:
  /v1/contacts/tags/add:
    post:
      tags:
        - Contacts
      summary: Add tags to contacts
      description: >-
        Apply tags to contacts in bulk: every tag in `tagIds` to every contact
        in `contactIds` (up to 10000 contacts and 50 tags per call; split larger
        selections). Idempotent: pairs that already exist are skipped. Any
        contact or tag id outside the workspace (including a company tag id)
        rejects the whole call with 404 before anything is written. Requires
        contact and company tags on the workspace: without them every tag
        endpoint answers 400 with `details.code` `ENTITY_TAGS_NOT_ENABLED`; tell
        the user instead of retrying.

            > **Required scope:** `CONTACTS_WRITE`
            >
            > **Rate limit:** 30 requests per minute
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                contactIds:
                  type: array
                  items:
                    type: integer
                    exclusiveMinimum: 0
                    maximum: 2147483647
                  minItems: 1
                  maxItems: 10000
                  description: IDs of the contacts (1 to 10000).
                tagIds:
                  type: array
                  items:
                    type: integer
                    exclusiveMinimum: 0
                    maximum: 2147483647
                  minItems: 1
                  maxItems: 50
                  description: >-
                    IDs of the tags to apply or remove (1 to 50), from the
                    matching get-tags endpoint. Contact tags and company tags
                    are separate pools.
              required:
                - contactIds
                - tagIds
            example:
              contactIds:
                - 101
                - 205
              tagIds:
                - 12
      responses:
        '200':
          description: The tags were applied
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - success
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      assigned:
                        type: integer
                        description: >-
                          Number of new (entity, tag) pairs. Pairs that already
                          existed are skipped and not counted.
                    required:
                      - assigned
                required:
                  - status
                  - message
                  - data
        '400':
          description: >-
            Tags are not enabled for this workspace (`details.code`
            `ENTITY_TAGS_NOT_ENABLED`), or the body is invalid.
        '404':
          description: A contact or tag id is not in this workspace; nothing was written
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````

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