# “Invitations” Endpoints - POST Creates a new invitation for the user

**URL:** <https://community.toggl.com/t/invitations-endpoints-post-creates-a-new-invitation-for-the-user/326>\
**Category:** API References\
**Tags:** user, api, endpoints, create, invitation\
**Created:** [December 2, 2024, 11:59am UTC](https://community.toggl.com/t/invitations-endpoints-post-creates-a-new-invitation-for-the-user/326 "2024-12-02T11:59:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Support](https://yyz2.discourse-cdn.com/flex012/user_avatar/community.toggl.com/support/32/1577_2.png) [@Support](https://community.toggl.com/u/Support)\
**Post date:** [December 2, 2024, 11:59am UTC](https://community.toggl.com/t/invitations-endpoints-post-creates-a-new-invitation-for-the-user/326/1 "2024-12-02T11:59:47Z")

</div>

```auto
https://api.track.toggl.com/api/v9/organizations/{organization_id}/invitations

```

Creates a new invitation for the user.

- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust

```auto
extern crate tokio;extern crate serde_json;use reqwest::{Client};use reqwest::header::{CONTENT_TYPE};#[tokio::main]async fn main() -> Result<(), reqwest::Error> { let client = Client::new().basic_auth("<email>", "<password>"); let json = client.request(Method::POST, "https://api.track.toggl.com/api/v9/organizations/{organization_id}/invitations".to_string()).json(&serde_json::json!(\{"emails":[\{\}],"groups":[\{\}],"project_invite":\{"manager":"boolean","project_id":"integer","workspace_id":"integer"\},"skip_email":"boolean","workspaces":[\{"admin":"boolean","integration_data":\{"external_id":"string","external_type":"string","provider":"string"\},"role":"string","role_id":"integer","workspace_id":"integer"\}]\})) .header(CONTENT_TYPE, "application/json") .send() .await? .json() .await?; println!("{:#?}", json); Ok(())}

```

### Parameters[​](https://engineering.toggl.com/docs/api/invitations/#parameters-2)

#### Path[​](https://engineering.toggl.com/docs/api/invitations/#path-2)

| name | type | required | description |
| --- | --- | --- | --- |
| organization\_id | integer | true | Numeric ID of the organization. |

#### Body[​](https://engineering.toggl.com/docs/api/invitations/#body)

| Name | Type | Description |
| --- | --- | --- |
| emails | Array of string | - |
| groups | Array of integer | - |
| project\_invite | object | - |
| skip\_email | boolean | - |
| workspaces | Array of object | - |

##### project\_invite[​](https://engineering.toggl.com/docs/api/invitations/#project_invite)

| Name | Type | Description |
| --- | --- | --- |
| manager | boolean | - |
| project\_id | integer | - |
| workspace\_id | integer | - |

##### workspaces[​](https://engineering.toggl.com/docs/api/invitations/#workspaces)

| Name | Type | Description |
| --- | --- | --- |
| admin | boolean | - |
| integration\_data | object | - |
| role | string | - |
| role\_id | integer | - |
| workspace\_id | integer | - |

##### integration\_data[​](https://engineering.toggl.com/docs/api/invitations/#integration_data)

| Name | Type | Description |
| --- | --- | --- |
| external\_id | string | - |
| external\_type | string | - |
| provider | string | - |

### Response[​](https://engineering.toggl.com/docs/api/invitations/#response-2)

#### 200[​](https://engineering.toggl.com/docs/api/invitations/#200-2)

Created user invitations

| Name | Type | Description |
| --- | --- | --- |
| data | Array of object | - |
| messages | Array of string | - |

##### data[​](https://engineering.toggl.com/docs/api/invitations/#data)

| Name | Type | Description |
| --- | --- | --- |
| email | string | - |
| invitation\_id | integer | - |
| invite\_url | string | - |
| organization\_id | integer | - |
| recipient\_id | integer | - |
| sender\_id | integer | - |
| workspaces | Array of object | - |

##### workspaces[​](https://engineering.toggl.com/docs/api/invitations/#workspaces-1)

| Name | Type | Description |
| --- | --- | --- |
| user\_id | integer | - |
| workspace\_id | integer | - |
| workspace\_user\_id | integer | - |

#### 400[​](https://engineering.toggl.com/docs/api/invitations/#400)

Possible error messages:

- Invalid JSON input
- Invalid organization id
- at least one email is required
- at least one workspace is required
- Missing e-mail
- Invalid e-mail: ‘…’
- invalid workspace ID
- Active user limit is 5. Upgrade to add more active users
- Invitation limit reached (please try again later; or upgrade)
- User with e-mail ‘…’ is already an inactive member of the organization

#### 403[​](https://engineering.toggl.com/docs/api/invitations/#403-2)

Forbidden
