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

# Invite Users

POST https://api.devin.ai/v3/enterprise/members/users
Content-Type: application/json

Reference: https://devin.ferndocs.com/api-reference/v-3/bulk-invite-enterprise-users

## Authentication

- `Authorization` header (bearer token, required) — Personal API Key (apk_user_*) or Service API Key (apk_*)

## Request

### Body (application/json)

This endpoint expects an UserBulkCreateRequest.

- `emails` (list of string, required)
- `enterprise_role_id` (string, required)

## Response

### 200

Successful Response

- `list of User`

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### User

- `email` (string, required, nullable)
- `name` (string, required, nullable)
- `role_assignments` (list of RoleAssignment, required)
- `user_id` (string, required)

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### RoleAssignment

- `role` (Role, required)
- `org_id` (string, optional, nullable)

### ValidationErrorLocItems

### Role

- `role_id` (string, required)
- `role_name` (string, required)
- `role_type` (enum, required)
  - Allowed values: `enterprise`, `org`

## Examples

**Request**

```json
{
  "emails": [
    "jane.doe@example.com",
    "john.smith@example.com"
  ],
  "enterprise_role_id": "ent-role-9f8b7c6d"
}
```

**Response**

```json
[
  {
    "email": "jane.doe@example.com",
    "name": "Jane Doe",
    "role_assignments": [
      {
        "role": {
          "role_id": "ent-role-9f8b7c6d",
          "role_name": "Enterprise Administrator",
          "role_type": "enterprise"
        },
        "org_id": "org-12345"
      }
    ],
    "user_id": "user-001a2b3c"
  },
  {
    "email": "john.smith@example.com",
    "name": "John Smith",
    "role_assignments": [
      {
        "role": {
          "role_id": "ent-role-9f8b7c6d",
          "role_name": "Enterprise Administrator",
          "role_type": "enterprise"
        },
        "org_id": "org-12345"
      }
    ],
    "user_id": "user-004d5e6f"
  }
]
```

**SDK Code**

```python
import requests

url = "https://api.devin.ai/v3/enterprise/members/users"

payload = {
    "emails": ["jane.doe@example.com", "john.smith@example.com"],
    "enterprise_role_id": "ent-role-9f8b7c6d"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.devin.ai/v3/enterprise/members/users';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"emails":["jane.doe@example.com","john.smith@example.com"],"enterprise_role_id":"ent-role-9f8b7c6d"}'
};

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.devin.ai/v3/enterprise/members/users"

	payload := strings.NewReader("{\n  \"emails\": [\n    \"jane.doe@example.com\",\n    \"john.smith@example.com\"\n  ],\n  \"enterprise_role_id\": \"ent-role-9f8b7c6d\"\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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.devin.ai/v3/enterprise/members/users")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"emails\": [\n    \"jane.doe@example.com\",\n    \"john.smith@example.com\"\n  ],\n  \"enterprise_role_id\": \"ent-role-9f8b7c6d\"\n}"

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.devin.ai/v3/enterprise/members/users")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"emails\": [\n    \"jane.doe@example.com\",\n    \"john.smith@example.com\"\n  ],\n  \"enterprise_role_id\": \"ent-role-9f8b7c6d\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.devin.ai/v3/enterprise/members/users', [
  'body' => '{
  "emails": [
    "jane.doe@example.com",
    "john.smith@example.com"
  ],
  "enterprise_role_id": "ent-role-9f8b7c6d"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.devin.ai/v3/enterprise/members/users");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"emails\": [\n    \"jane.doe@example.com\",\n    \"john.smith@example.com\"\n  ],\n  \"enterprise_role_id\": \"ent-role-9f8b7c6d\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "emails": ["jane.doe@example.com", "john.smith@example.com"],
  "enterprise_role_id": "ent-role-9f8b7c6d"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.devin.ai/v3/enterprise/members/users")! 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()
```