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

# Assign a company to a BDR agent

> Creates or updates the outreach row for this company and agent. waitForEnrichment is required. true waits until enrichment finishes (and queues it when the company has a website or domain and an enrichment profile). false lets the agent evaluate the company on its next run using the fields already stored. An optional nextActionNote is stored as a human instruction.



## OpenAPI

````yaml https://app.alvahq.com/api/v1/openapi post /api/v1/company/{id}/bdr-agent
openapi: 3.1.0
info:
  title: Alva API
  version: 1.0.0
  description: >
    The Alva API provides programmatic access to your CRM data. Use it to
    integrate Alva with other applications, build custom workflows, or connect
    via platforms like Zapier.


    ## Authentication


    All API requests require a valid API key passed as a Bearer token:


    ```

    Authorization: Bearer alva_sk_your_api_key_here

    ```


    API keys can be created and managed in **Settings > Developer** within the
    Alva application.


    ## Rate Limiting


    API requests are rate limited to **100 requests per minute** per API key.
    Rate limit information is included in response headers:


    - `X-RateLimit-Limit` - Maximum requests per minute

    - `X-RateLimit-Remaining` - Requests remaining in current window

    - `X-RateLimit-Reset` - Unix timestamp when the window resets


    ## Pagination


    List endpoints support pagination via query parameters:


    - `page` - Page number (default: 1)

    - `limit` - Items per page (default: 25, max: 100)


    ## Sorting


    List endpoints support sorting:


    - `sort` - Sort field and direction, e.g. `sort=createdAt:desc`


    ## Errors


    All errors follow a consistent format:


    ```json

    {
      "error": "Error Type",
      "message": "Human-readable description",
      "details": { "field": ["Validation message"] }
    }

    ```
  contact:
    name: Alva Support
    url: https://alva.ai
servers:
  - url: https://app.alvahq.com
    description: Current environment
security:
  - bearerAuth: []
tags:
  - name: Companies
    description: Manage companies in your CRM
  - name: Contacts
    description: Manage contacts and people
  - name: Deals
    description: Manage sales deals and pipeline
  - name: Activities
    description: Log and track activities (calls, meetings, emails, etc.)
  - name: Pipeline
    description: Pipeline stages and methodology metadata
  - name: Custom Fields
    description: Define custom fields on companies and contacts
  - name: Email Templates
    description: >-
      Manage email templates and template groups. Use {{company.custom.<key>}}
      merge tags in subject and body.
  - name: Account
    description: API key, account members and company tags
  - name: BDR Agents
    description: List BDR agents and assign a company to one
paths:
  /api/v1/company/{id}/bdr-agent:
    post:
      tags:
        - BDR Agents
      summary: Assign a company to a BDR agent
      description: >-
        Creates or updates the outreach row for this company and agent.
        waitForEnrichment is required. true waits until enrichment finishes (and
        queues it when the company has a website or domain and an enrichment
        profile). false lets the agent evaluate the company on its next run
        using the fields already stored. An optional nextActionNote is stored as
        a human instruction.
      operationId: assignCompanyToBdrAgent
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The company ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssignCompanyBdrAgent'
            example:
              agentId: ''
              waitForEnrichment: true
              nextActionNote: ''
      responses:
        '200':
          description: BdrAgentAssignment
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    description: Human-readable confirmation of the action.
                  data:
                    $ref: '#/components/schemas/BdrAgentAssignment'
                  resource:
                    type: string
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  schemas:
    AssignCompanyBdrAgent:
      type: object
      required:
        - agentId
        - waitForEnrichment
      properties:
        agentId:
          type: string
          format: uuid
        waitForEnrichment:
          type: boolean
          description: >-
            true waits for enrichment. false lets the agent start on the next
            run.
        nextActionNote:
          type: string
          nullable: true
    BdrAgentAssignment:
      type: object
      properties:
        outreachId:
          type: string
          format: uuid
        companyId:
          type: string
          format: uuid
        companyName:
          type: string
        agentId:
          type: string
          format: uuid
        agentName:
          type: string
        agentStatus:
          type: string
        agentMode:
          type: string
        status:
          type: string
        waitForEnrichment:
          type: boolean
        nextActionNote:
          type: string
          nullable: true
        nextEvaluationAt:
          type: string
          format: date-time
          nullable: true
        eligibleNow:
          type: boolean
          description: >-
            The company passes the queue gates. A paused agent still will not
            run until it is active.
        enrichmentQueued:
          type: boolean
        enrichmentBlockedReason:
          type: string
          nullable: true
        linkedInBlockedReason:
          type: string
          nullable: true
        blockedReason:
          type: string
          nullable: true
        created:
          type: boolean
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        details:
          type: object
          nullable: true
  responses:
    Unauthorised:
      description: Authentication failed - invalid, expired, or revoked API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Unauthorised
            message: Invalid or revoked API key
    Forbidden:
      description: The API key does not have the required scope
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Forbidden
            message: Missing required scope
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Not Found
            message: Company with id 'xxx' not found
    ValidationError:
      description: Request body validation failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Unprocessable Entity
            message: Validation failed
            details:
              name:
                - Name is required
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'API key from Settings > Developer. Format: alva_sk_...'

````

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