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

# Get all agents by organization ID

> Get all agents by organization ID. Returns an array of AgentPublicDto. Optionally filter by campaign group ID — only agents belonging to the specified group within the same organization will be returned.



## OpenAPI

````yaml https://api.callers.ai/openapi-json get /campaigns
openapi: 3.0.0
info:
  title: Callers API
  description: API documentation for Callers, providing endpoints for seamless integration.
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.callers.ai
security: []
tags: []
paths:
  /campaigns:
    get:
      tags:
        - Agents
      summary: Get all agents by organization ID
      description: >-
        Get all agents by organization ID. Returns an array of AgentPublicDto.
        Optionally filter by campaign group ID — only agents belonging to the
        specified group within the same organization will be returned.
      operationId: CampaignPublicController_getCampaignsByOrganizationId[1]
      parameters:
        - name: campaignGroupId
          required: false
          in: query
          description: >-
            Optional filter: id of the campaign group as a string ObjectId
            value. When provided, only agents belonging to this group within the
            organization are returned.
          schema:
            type: string
        - name: agentGroupId
          required: false
          in: query
          description: >-
            Optional filter: id of the agent group as a string ObjectId value.
            This is an alias of campaignGroupId.
          schema:
            type: string
        - name: organizationId
          required: true
          in: query
          description: Id of the organization as a string ObjectId value.
          schema:
            type: string
        - name: x-sub-organization-id
          in: header
          schema:
            type: string
          description: >-
            Optional sub organization ID. Must belong to your main organization
            API key.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - success
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/AgentExternalPublicDto'
        '404':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
      security:
        - Authorization: []
components:
  schemas:
    AgentExternalPublicDto:
      type: object
      properties:
        id:
          type: string
          description: The id of the campaign. string representation of a ObjectId.
        name:
          type: string
          description: The name of the campaign.
        active:
          type: boolean
          description: >-
            Whether the campaign is active (running). Derived from the campaign
            active field.
        pauseNewChats:
          type: boolean
          description: >-
            Whether new chats are paused. When true, stops initiating new chats
            while allowing ongoing chats to complete.
        firstInteractionAt:
          type: string
          description: >-
            The date and time of the first interaction (call or chat) in the
            campaign in ISO string format.
        completedAt:
          type: string
          description: >-
            The date and time when the campaign was completed in ISO string
            format.
        callParams:
          description: The call parameters of the campaign.
          allOf:
            - $ref: '#/components/schemas/CampaignCallParamsPublicDto'
        emailParams:
          description: The email parameters of the campaign.
          allOf:
            - $ref: '#/components/schemas/CampaignEmailParamsPublicDto'
        organizationId:
          type: string
          description: The id of the organization. string representation of a ObjectId.
        incomingPhoneNumber:
          type: string
          description: The incoming phone number of the campaign.
        webhooks:
          description: The webhook url of the campaign.
          type: array
          items:
            type: string
        slackUrl:
          type: string
          description: The Slack notifications URL of the campaign.
        isIncoming:
          type: boolean
          description: >-
            Boolean value defines if the campaign is incoming or outgoing. True
            if the campaign is incoming, false if the campaign is outgoing.
        variables:
          description: List of variable used in the campaign.
          type: array
          items:
            type: string
        campaignGroupId:
          type: string
          description: >-
            The id of the campaign group this campaign belongs to. Null if the
            campaign is not part of any group.
          nullable: true
        campaignGroupName:
          type: string
          description: >-
            The name of the campaign group this campaign belongs to. Null if the
            campaign is not part of any group or the group could not be
            resolved.
          nullable: true
        agentGroupId:
          type: string
          description: >-
            Agent-facing alias of campaignGroupId. Null if the agent is not part
            of a group.
          nullable: true
        agentGroupName:
          type: string
          description: >-
            Agent-facing alias of campaignGroupName. Null if the group cannot be
            resolved.
          nullable: true
      required:
        - id
        - name
        - active
        - firstInteractionAt
        - completedAt
        - callParams
        - organizationId
        - webhooks
        - slackUrl
        - isIncoming
        - variables
        - agentGroupId
        - agentGroupName
    CampaignCallParamsPublicDto:
      type: object
      properties:
        phonesFrom:
          description: The array of the available phone numbers.
          type: array
          items:
            type: string
        timezone:
          type: string
          description: The timezone of the campaign.
        daysOfWeek:
          description: Days of the week the campaign is active.
          type: array
          items:
            type: string
        language:
          type: string
          description: The language of the calls.
        approvedCountries:
          description: The array of the approved countries to call.
          type: array
          items:
            type: string
      required:
        - phonesFrom
        - timezone
        - daysOfWeek
        - language
        - approvedCountries
    CampaignEmailParamsPublicDto:
      type: object
      properties:
        outboundConnectionIds:
          description: IDs of outbound email connections used for sending.
          type: array
          items:
            type: string
        inboundConnectionIds:
          description: IDs of inbound email connections used for receiving replies.
          type: array
          items:
            type: string
        emailSelectionStrategy:
          type: string
          description: >-
            The strategy for selecting outbound email connections when more than
            one is configured.
          enum:
            - ROTATE
            - RANDOM
            - FIXED
        signature:
          type: string
          description: The email signature HTML content.
        signatureName:
          type: string
          description: The display name for the email signature.
        defaultSubject:
          type: string
          description: The default subject line for emails.
        timezone:
          type: string
          description: The timezone of the email campaign.
        followUpSteps:
          description: The ordered list of follow-up steps to send when there is no reply.
          type: array
          items:
            $ref: '#/components/schemas/CampaignEmailFollowUpStepPublicDto'
        followUpRespectSchedule:
          type: boolean
          description: Whether follow-up sends respect the campaign availability schedule.
        followUpOnlyIfNoReply:
          type: boolean
          description: >-
            Whether follow-ups stop once the contact has ever replied, rather
            than continuing on cadence regardless.
        fallbackEnabled:
          type: boolean
          description: Whether fallback behavior is enabled.
        retryFollowUp:
          type: boolean
          description: Whether to retry follow-up emails.
      required:
        - outboundConnectionIds
        - inboundConnectionIds
        - emailSelectionStrategy
        - followUpSteps
        - followUpRespectSchedule
        - followUpOnlyIfNoReply
        - fallbackEnabled
        - retryFollowUp
    CampaignEmailFollowUpStepPublicDto:
      type: object
      properties:
        delayValue:
          type: number
          description: >-
            The wait time before this follow-up fires, counted from the previous
            send.
        delayUnit:
          type: string
          description: The unit for delayValue.
          enum:
            - min
            - hour
            - day
        contentMode:
          type: string
          description: >-
            Whether this follow-up sends a fixed template or an AI-drafted
            message.
          enum:
            - HUMAN_TEMPLATE
            - AI_TEMPLATE
        body:
          type: string
          description: The template body, used when contentMode is HUMAN_TEMPLATE.
        prompt:
          type: string
          description: The AI prompt, used when contentMode is AI_TEMPLATE.
      required:
        - delayValue
        - delayUnit
        - contentMode
  securitySchemes:
    Authorization:
      type: apiKey
      in: header
      name: Authorization

````