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

# Invite Users

POST https://{tenant}.atomicwork.com/api/v1/users/invite
Content-Type: application/json

Reference: https://developers.atomicwork.com/api-reference/atomicwork-public-api/users/postapi-v-1-users-invite

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /api/v1/users/invite:
    post:
      operationId: postapi-v-1-users-invite
      summary: Invite Users
      tags:
        - subpackage_users
      parameters:
        - name: X-Api-Key
          in: header
          required: true
          schema:
            type: string
        - name: X-Workspace-Id
          in: header
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Users_postapi_v1_users_invite_Response_200
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                emails:
                  type: array
                  items:
                    type: string
                    format: email
                org_roles:
                  type: array
                  items:
                    type: integer
                    format: int64
                type:
                  $ref: >-
                    #/components/schemas/ApiV1UsersInvitePostRequestBodyContentApplicationJsonSchemaType
                send_email:
                  type: boolean
                  default: true
                workspaces:
                  type: array
                  items:
                    $ref: >-
                      #/components/schemas/ApiV1UsersInvitePostRequestBodyContentApplicationJsonSchemaWorkspacesItems
                workspace_roles:
                  type: array
                  items:
                    type: integer
                    format: int64
                workspace_ids:
                  type: array
                  items:
                    type: integer
                    format: int64
servers:
  - url: https://{tenant}.atomicwork.com
    description: Your Atomicwork tenant
components:
  schemas:
    ApiV1UsersInvitePostRequestBodyContentApplicationJsonSchemaType:
      type: string
      enum:
        - EMPLOYEE
        - EXTERNAL
        - AI_EMPLOYEE
      title: ApiV1UsersInvitePostRequestBodyContentApplicationJsonSchemaType
    ApiV1UsersInvitePostRequestBodyContentApplicationJsonSchemaWorkspacesItems:
      type: object
      properties:
        id:
          type: integer
          format: int64
        roles:
          type: array
          items:
            type: integer
            format: int64
      title: >-
        ApiV1UsersInvitePostRequestBodyContentApplicationJsonSchemaWorkspacesItems
    Users_postapi_v1_users_invite_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Users_postapi_v1_users_invite_Response_200
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

```

## Examples



**Request**

```json
{
  "emails": [
    "jane.doe@example.com",
    "john.smith@externalpartner.com"
  ],
  "org_roles": [
    101,
    205
  ],
  "type": "EMPLOYEE",
  "send_email": true,
  "workspaces": [
    {
      "id": 42,
      "roles": [
        3,
        7
      ]
    },
    {
      "id": 58,
      "roles": [
        2
      ]
    }
  ],
  "workspace_roles": [
    5,
    9
  ],
  "workspace_ids": [
    42,
    58
  ]
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://{tenant}.atomicwork.com/api/v1/users/invite"

payload = {
    "emails": ["jane.doe@example.com", "john.smith@externalpartner.com"],
    "org_roles": [101, 205],
    "type": "EMPLOYEE",
    "send_email": True,
    "workspaces": [
        {
            "id": 42,
            "roles": [3, 7]
        },
        {
            "id": 58,
            "roles": [2]
        }
    ],
    "workspace_roles": [5, 9],
    "workspace_ids": [42, 58]
}
headers = {
    "X-Workspace-Id": "{{workspace_id}}",
    "X-Api-Key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://{tenant}.atomicwork.com/api/v1/users/invite';
const options = {
  method: 'POST',
  headers: {
    'X-Workspace-Id': '{{workspace_id}}',
    'X-Api-Key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"emails":["jane.doe@example.com","john.smith@externalpartner.com"],"org_roles":[101,205],"type":"EMPLOYEE","send_email":true,"workspaces":[{"id":42,"roles":[3,7]},{"id":58,"roles":[2]}],"workspace_roles":[5,9],"workspace_ids":[42,58]}'
};

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://{tenant}.atomicwork.com/api/v1/users/invite"

	payload := strings.NewReader("{\n  \"emails\": [\n    \"jane.doe@example.com\",\n    \"john.smith@externalpartner.com\"\n  ],\n  \"org_roles\": [\n    101,\n    205\n  ],\n  \"type\": \"EMPLOYEE\",\n  \"send_email\": true,\n  \"workspaces\": [\n    {\n      \"id\": 42,\n      \"roles\": [\n        3,\n        7\n      ]\n    },\n    {\n      \"id\": 58,\n      \"roles\": [\n        2\n      ]\n    }\n  ],\n  \"workspace_roles\": [\n    5,\n    9\n  ],\n  \"workspace_ids\": [\n    42,\n    58\n  ]\n}")

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

	req.Header.Add("X-Workspace-Id", "{{workspace_id}}")
	req.Header.Add("X-Api-Key", "<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://{tenant}.atomicwork.com/api/v1/users/invite")

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

request = Net::HTTP::Post.new(url)
request["X-Workspace-Id"] = '{{workspace_id}}'
request["X-Api-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"emails\": [\n    \"jane.doe@example.com\",\n    \"john.smith@externalpartner.com\"\n  ],\n  \"org_roles\": [\n    101,\n    205\n  ],\n  \"type\": \"EMPLOYEE\",\n  \"send_email\": true,\n  \"workspaces\": [\n    {\n      \"id\": 42,\n      \"roles\": [\n        3,\n        7\n      ]\n    },\n    {\n      \"id\": 58,\n      \"roles\": [\n        2\n      ]\n    }\n  ],\n  \"workspace_roles\": [\n    5,\n    9\n  ],\n  \"workspace_ids\": [\n    42,\n    58\n  ]\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://{tenant}.atomicwork.com/api/v1/users/invite")
  .header("X-Workspace-Id", "{{workspace_id}}")
  .header("X-Api-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"emails\": [\n    \"jane.doe@example.com\",\n    \"john.smith@externalpartner.com\"\n  ],\n  \"org_roles\": [\n    101,\n    205\n  ],\n  \"type\": \"EMPLOYEE\",\n  \"send_email\": true,\n  \"workspaces\": [\n    {\n      \"id\": 42,\n      \"roles\": [\n        3,\n        7\n      ]\n    },\n    {\n      \"id\": 58,\n      \"roles\": [\n        2\n      ]\n    }\n  ],\n  \"workspace_roles\": [\n    5,\n    9\n  ],\n  \"workspace_ids\": [\n    42,\n    58\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://{tenant}.atomicwork.com/api/v1/users/invite', [
  'body' => '{
  "emails": [
    "jane.doe@example.com",
    "john.smith@externalpartner.com"
  ],
  "org_roles": [
    101,
    205
  ],
  "type": "EMPLOYEE",
  "send_email": true,
  "workspaces": [
    {
      "id": 42,
      "roles": [
        3,
        7
      ]
    },
    {
      "id": 58,
      "roles": [
        2
      ]
    }
  ],
  "workspace_roles": [
    5,
    9
  ],
  "workspace_ids": [
    42,
    58
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Api-Key' => '<apiKey>',
    'X-Workspace-Id' => '{{workspace_id}}',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://{tenant}.atomicwork.com/api/v1/users/invite");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Workspace-Id", "{{workspace_id}}");
request.AddHeader("X-Api-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"emails\": [\n    \"jane.doe@example.com\",\n    \"john.smith@externalpartner.com\"\n  ],\n  \"org_roles\": [\n    101,\n    205\n  ],\n  \"type\": \"EMPLOYEE\",\n  \"send_email\": true,\n  \"workspaces\": [\n    {\n      \"id\": 42,\n      \"roles\": [\n        3,\n        7\n      ]\n    },\n    {\n      \"id\": 58,\n      \"roles\": [\n        2\n      ]\n    }\n  ],\n  \"workspace_roles\": [\n    5,\n    9\n  ],\n  \"workspace_ids\": [\n    42,\n    58\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Workspace-Id": "{{workspace_id}}",
  "X-Api-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "emails": ["jane.doe@example.com", "john.smith@externalpartner.com"],
  "org_roles": [101, 205],
  "type": "EMPLOYEE",
  "send_email": true,
  "workspaces": [
    [
      "id": 42,
      "roles": [3, 7]
    ],
    [
      "id": 58,
      "roles": [2]
    ]
  ],
  "workspace_roles": [5, 9],
  "workspace_ids": [42, 58]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://{tenant}.atomicwork.com/api/v1/users/invite")! 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()
```