> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.messageblue.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.messageblue.ai/_mcp/server.

# Get mappings for multiple agents in one request

POST https://api.messageblue.ai/agents/mappings/bulk
Content-Type: application/json

Accepts a list of agent phone numbers and returns all their current mapping records in a single response.

Reference: https://docs.messageblue.ai/api-reference/agents/bulk-get-agent-mappings

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: swagger
  version: 1.0.0
paths:
  /agents/mappings/bulk:
    post:
      operationId: bulkGetAgentMappings
      summary: Get mappings for multiple agents in one request
      description: >-
        Accepts a list of agent phone numbers and returns all their current
        mapping records in a single response.
      tags:
        - agents
      parameters:
        - name: X-App-Id
          in: header
          description: >-
            Your MessageBlue App ID, sent in clear on every request. It is
            paired with request signing: each request is also signed with your
            App Secret (see the **Authentication** tag). The App Secret itself
            is NEVER transmitted — it is only the HMAC signing key.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkAgentMappingsResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkAgentMappingsRequest'
servers:
  - url: https://api.messageblue.ai
    description: Production
  - url: http://localhost:8080
    description: Local development
components:
  schemas:
    BulkAgentMappingsRequest:
      type: object
      properties:
        agentNumbers:
          type: array
          items:
            type: string
      title: BulkAgentMappingsRequest
    MappingExport:
      type: object
      properties:
        accountId:
          type: string
        userNumber:
          type: string
        agentNumber:
          type: string
        createdAt:
          type:
            - number
            - 'null'
          format: double
        respondedAt:
          type:
            - number
            - 'null'
          format: double
        lastRespondedAt:
          type:
            - number
            - 'null'
          format: double
        receivedAt:
          type:
            - number
            - 'null'
          format: double
        lastReceivedAt:
          type:
            - number
            - 'null'
          format: double
        outbound:
          type: number
          format: double
        inbound:
          type: number
          format: double
        consecutiveCount:
          type: number
          format: double
        lastWarningSentAt:
          type:
            - number
            - 'null'
          format: double
      title: MappingExport
    BulkAgentMappingsResponseData:
      type: object
      properties:
        agentNumbers:
          type: array
          items:
            type: string
        totalMappings:
          type: number
          format: double
        mappings:
          type: array
          items:
            $ref: '#/components/schemas/MappingExport'
      description: Endpoint-specific payload wrapped in a standard success envelope.
      title: BulkAgentMappingsResponseData
    ResponseMeta:
      type: object
      properties:
        requestId:
          type: string
          format: uuid
        timestamp:
          type: string
          format: date-time
      required:
        - requestId
        - timestamp
      title: ResponseMeta
    BulkAgentMappingsResponse:
      type: object
      properties:
        ok:
          type: boolean
        data:
          $ref: '#/components/schemas/BulkAgentMappingsResponseData'
          description: Endpoint-specific payload wrapped in a standard success envelope.
        meta:
          $ref: '#/components/schemas/ResponseMeta'
      required:
        - ok
        - data
        - meta
      title: BulkAgentMappingsResponse
    FieldError:
      type: object
      properties:
        field:
          type: string
        issue:
          type: string
        message:
          type: string
      required:
        - field
        - issue
        - message
      title: FieldError
    ErrorResponseErrorDetails0:
      type: array
      items:
        $ref: '#/components/schemas/FieldError'
      title: ErrorResponseErrorDetails0
    ErrorResponseErrorDetails:
      oneOf:
        - $ref: '#/components/schemas/ErrorResponseErrorDetails0'
        - type: object
          additionalProperties:
            description: Any type
      description: Field validation errors (array) or domain-specific context (object).
      title: ErrorResponseErrorDetails
    ErrorResponseError:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        requestId:
          type: string
          format: uuid
        details:
          $ref: '#/components/schemas/ErrorResponseErrorDetails'
          description: Field validation errors (array) or domain-specific context (object).
      required:
        - code
        - message
        - requestId
      title: ErrorResponseError
    ErrorResponse:
      type: object
      properties:
        ok:
          type: boolean
        error:
          $ref: '#/components/schemas/ErrorResponseError'
      required:
        - ok
        - error
      title: ErrorResponse
  securitySchemes:
    appId:
      type: apiKey
      in: header
      name: X-App-Id
      description: >-
        Your MessageBlue App ID, sent in clear on every request. It is paired
        with request signing: each request is also signed with your App Secret
        (see the **Authentication** tag). The App Secret itself is NEVER
        transmitted — it is only the HMAC signing key.

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{
  "ok": true,
  "data": {
    "agentNumbers": [
      "+14155552671",
      "+14155552672"
    ],
    "totalMappings": 2,
    "mappings": [
      {
        "accountId": "acc_9f8b7c6d5e4a3b2c1d0e",
        "userNumber": "+14155550123",
        "agentNumber": "+14155552671",
        "createdAt": 1689004800000,
        "respondedAt": 1689091200000,
        "lastRespondedAt": 1689177600000,
        "receivedAt": 1689008400000,
        "lastReceivedAt": 1689181200000,
        "outbound": 150,
        "inbound": 120,
        "consecutiveCount": 5,
        "lastWarningSentAt": 1689100000000
      },
      {
        "accountId": "acc_1a2b3c4d5e6f7g8h9i0j",
        "userNumber": "+14155550124",
        "agentNumber": "+14155552672",
        "createdAt": 1688900000000,
        "respondedAt": 1688986400000,
        "lastRespondedAt": 1689072800000,
        "receivedAt": 1688903600000,
        "lastReceivedAt": 1689076400000,
        "outbound": 200,
        "inbound": 180,
        "consecutiveCount": 3,
        "lastWarningSentAt": 1688990000000
      }
    ]
  },
  "meta": {
    "requestId": "550e8400-e29b-41d4-a716-446655440000",
    "timestamp": "2026-07-10T06:00:00.000Z"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.messageblue.ai/agents/mappings/bulk"

payload = {}
headers = {
    "X-App-Id": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.messageblue.ai/agents/mappings/bulk';
const options = {
  method: 'POST',
  headers: {'X-App-Id': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.messageblue.ai/agents/mappings/bulk"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-App-Id", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.messageblue.ai/agents/mappings/bulk")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-App-Id"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.messageblue.ai/agents/mappings/bulk")
  .header("X-App-Id", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.messageblue.ai/agents/mappings/bulk', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-App-Id' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.messageblue.ai/agents/mappings/bulk");
var request = new RestRequest(Method.POST);
request.AddHeader("X-App-Id", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-App-Id": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.messageblue.ai/agents/mappings/bulk")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```