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

# Search Contacts by Emails

> Searches for multiple contacts by their email addresses in a single request. Returns all matching contacts found in your project.

```bash cURL theme={null}
curl --request POST \
  --url https://api.autosend.com/v1/contacts/search/emails \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "emails": [
    "john.doe@example.com",
    "jane.smith@example.com"
  ]
}'
```

```python Python theme={null}
import requests

url = "https://api.autosend.com/v1/contacts/search/emails"

headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

payload = {
    "emails": [
        "john.doe@example.com",
        "jane.smith@example.com"
    ]
}

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

```javascript JavaScript theme={null}
fetch('https://api.autosend.com/v1/contacts/search/emails', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    emails: [
      'john.doe@example.com',
      'jane.smith@example.com'
    ]
  })
})
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));
```

```php PHP theme={null}
<?php

$url = 'https://api.autosend.com/v1/contacts/search/emails';

$data = [
    'emails' => [
        'john.doe@example.com',
        'jane.smith@example.com'
    ]
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer <token>',
    'Content-Type: application/json'
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
```

```go Go theme={null}
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    url := "https://api.autosend.com/v1/contacts/search/emails"
    
    payload := map[string]interface{}{
        "emails": []string{
            "john.doe@example.com",
            "jane.smith@example.com",
        },
    }
    
    jsonData, _ := json.Marshal(payload)
    
    req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
    req.Header.Set("Authorization", "Bearer <token>")
    req.Header.Set("Content-Type", "application/json")
    
    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        fmt.Println("Error:", err)
        return
    }
    defer resp.Body.Close()
    
    fmt.Println("Response Status:", resp.Status)
}
```

```java Java theme={null}
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;

public class SearchContactsByEmails {
    public static void main(String[] args) {
        try {
            URL url = new URL("https://api.autosend.com/v1/contacts/search/emails");
            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            
            con.setRequestMethod("POST");
            con.setRequestProperty("Authorization", "Bearer <token>");
            con.setRequestProperty("Content-Type", "application/json");
            con.setDoOutput(true);
            
            String jsonInputString = "{\n" +
                "  \"emails\": [\n" +
                "    \"john.doe@example.com\",\n" +
                "    \"jane.smith@example.com\"\n" +
                "  ]\n" +
                "}";
            
            try (OutputStream os = con.getOutputStream()) {
                byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8);
                os.write(input, 0, input.length);
            }
            
            int status = con.getResponseCode();
            System.out.println("Response Status: " + status);
            
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
```

```ruby Ruby theme={null}
require 'net/http'
require 'json'
require 'uri'

uri = URI('https://api.autosend.com/v1/contacts/search/emails')

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

request = Net::HTTP::Post.new(uri.path)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'

request.body = {
  emails: [
    'john.doe@example.com',
    'jane.smith@example.com'
  ]
}.to_json

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

```json Response theme={null}
{
  "success": true,
  "data": {
    "contacts": [
      {
        "id": "507f1f77bcf86cd799439011",
        "email": "john.doe@example.com",
        "firstName": "John",
        "lastName": "Doe",
        "userId": "user_12345",
        "contactProperties": {
          "company": "Acme Corp",
          "role": "Developer",
          "plan": "premium"
        },
        "updatedAt": "2024-01-15T10:30:00.000Z",
        "createdAt": "2024-01-15T10:30:00.000Z",
        "projectId": "229f1f77bcf86cd9273048038",
        "listIds": ["69929ee99ba41f12c56b710e"],
        "segmentIds": ["6a0c0fb56ae88a19f5a010a9"]
      }
    ]
  }
}
```

***

### Authorizations

**Authorizations** `string | header` *required*

Bearer authentication header of the form Bearer `<token>`, where `<token>` is your auth token.

### Body

Array of email addresses to search

**emails** `string[]` *required*

Array of email addresses (minimum 1, automatically normalized)

Example: `["john.doe@example.com", "jane.smith@example.com"]`

### Response

Contacts retrieved successfully

**success** `boolean`

Indicates if the request was successful

Example: `true`

**data** `object`

**child attributes**

**data.contacts** `array`

Array of contact objects

**child attributes**

**id** `string`

Contact ID

Example: `"507f1f77bcf86cd799439011"`

**email** `string`

Contact email address

Example: `"john.doe@example.com"`

**firstName** `string`

Contact's first name

Example: `"John"`

**lastName** `string`

Contact's last name

Example: `"Doe"`

**userId** `string`

Your application's user identifier

Example: `"user_12345"`

**contactProperties** `object`

Custom contact attributes

**child attributes**

**contactProperties.\{key}** `string`

Example:

```jsx theme={null}
{
  "company": "Acme Corp",
  "role": "Developer",
  "plan": "premium"
}
```

**createdAt** `string`

Contact creation timestamp

Example: `"2024-01-15T10:30:00.000Z"`

**updatedAt** `string`

Contact last update timestamp

Example: `"2024-01-15T10:30:00.000Z"`

**projectId** `string`

Project ID that the contact belongs to

Example: `"229f1f77bcf86cd9273048038"`

**listIds** `array`

Contact List IDs

Example: `["69929ee99ba41f12c56b710e"]`

**segmentIds** `array`

Segment IDs the contact belongs to

Example: `["6a0c0fb56ae88a19f5a010a9"]`


## OpenAPI

````yaml POST /contacts/search/emails
openapi: 3.1.0
info:
  title: AutoSend API
  description: AutoSend REST API for managing contacts and sending emails
  version: 1.0.0
servers:
  - url: https://api.autosend.com/v1
security:
  - bearerAuth: []
paths:
  /contacts/search/emails:
    post:
      summary: Search Contacts by Emails
      description: >-
        Searches for multiple contacts by their email addresses in a single
        request. Returns all matching contacts found in your project.
components: {}

````

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