> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# Invite a member

POST https://%7BYour_Space_Name%7D.signalwire.com/api/space/members
Content-Type: application/json

Sends an invitation to join the space. The member exists immediately with
`activated: false` and activates by accepting the invitation.

Only `admin` and `employee` can be assigned; `owner` is rejected with `invalid_role`.
Give a new member access to projects with
[Enable a member for a project](/docs/apis/rest/space/members/enable-member-project).

#### Permissions

Authenticate with a [Personal access token](/docs/apis/authorization#personal-access-tokens) whose holder is an owner or admin of the space. A project API token is not accepted on this endpoint, and a Personal access token has no scopes: the holder's role in the space is the whole authorization decision.

Reference: https://signalwire.com/docs/apis/rest/space/members/create-member

## Authentication

- `Authorization` header (basic auth, required) — Personal access token authentication for space-wide administration. Send HTTP Basic auth with an empty username and the Personal access token as the password. A Personal access token carries your own authority rather than a project's: it is created from your user menu in the Dashboard, is prefixed `pat_`, and has no scopes. The holder must be an owner or admin of the space named by the subdomain, and the token acts only on that space. Example: ``` Authorization: Basic base64(:pat_...) ```

## Request

### Body (application/json)

This endpoint expects an object.

- `email` (string, required) — The email address to invite. Must be a valid address that does not already belong to a member of the space (`already_a_member`).
- `role` (enum, required) — The role to assign: `admin` or `employee`. `owner` cannot be assigned (`invalid_role`).
  - Allowed values: `admin`, `employee`
- `name` (string, optional) — The member's name.

## Response

### 201

The request has succeeded and a new resource has been created as a result.

- `type` (enum, required) — The object type. Always `member`.
  - Allowed values: `member`
- `id` (string, required) — The unique identifier of the membership, used in the path of the member endpoints.
- `email` (string, required) — The member's email address.
- `name` (string, required, nullable) — The member's name, or `null` when none was given.
- `role` (enum, required) — The member's role in the space.
  - Allowed values: `owner`, `admin`, `employee`, `guest`
- `job_title` (enum, required, nullable) — The member's job title, or `null` when not set.
  - Allowed values: `entrepreneur`, `product_manager`, `developer`, `other`
- `activated` (boolean, required) — Whether the member has accepted the invitation. `false` until the invitation is accepted.
- `last_logged_in` (datetime, required, nullable) — The date and time the member last signed in, or `null` if they never have.
- `created_at` (datetime, required) — The date and time when the membership was created.
- `updated_at` (datetime, required) — The date and time when the membership was last updated.

## Errors

### 400 Bad Request Error

The request body is not valid JSON.

- `errors` (list of object, required) — List of validation errors.
  - `type` (string, required) — The category of error.
  - `code` (string, required) — A specific error code.
  - `message` (string, required) — A description of what caused the error.
  - `url` (string, required) — A link to documentation about this error.
  - `attribute` (string, optional, nullable) — The request parameter that caused the error, if applicable.

### 401 Unauthorized Error

The credential is missing, unknown, or revoked; its holder is not a member of the space in the subdomain; or the member is not an owner or admin. The body is the plain text `Unauthorized`. An unverified space instead receives the JSON body `{"message": "Please validate a phone number to access your account."}` on every endpoint under `/api/space`.

- `message` (string, required) — States that a phone number must be validated for the space before it can use the API.

### 422 Unprocessable Entity Error

The invited email already belongs to a member of the space (`already_a_member`), the `role` is not `admin` or `employee` (`invalid_role`), or the `email` is not a valid address.

- `errors` (list of object, required) — List of validation errors.
  - `type` (string, required) — The category of error.
  - `code` (string, required) — A specific error code.
  - `message` (string, required) — A description of what caused the error.
  - `url` (string, required) — A link to documentation about this error.
  - `attribute` (string, optional, nullable) — The request parameter that caused the error, if applicable.

### 500 Internal Server Error

An internal server error occurred.

- `error` (enum, required)
  - Allowed values: `Internal Server Error`

## Examples

**Request**

```json
{
  "email": "newhire@example.com",
  "role": "employee"
}
```

**Response**

```json
{
  "type": "member",
  "id": "9f8e7d6c-5b4a-4321-8765-fedcba987654",
  "email": "jane@example.com",
  "name": "Jane Doe",
  "role": "admin",
  "job_title": "developer",
  "activated": true,
  "last_logged_in": "2026-08-19T09:12:00Z",
  "created_at": "2026-02-01T00:00:00Z",
  "updated_at": "2026-08-19T09:12:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://{your_space_name}.signalwire.com/api/space/members"

payload = {
    "email": "newhire@example.com",
    "role": "employee"
}
headers = {
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, auth=("<username>", "<personal_access_token>"))

print(response.json())
```

```javascript
const url = 'https://{your_space_name}.signalwire.com/api/space/members';
const credentials = btoa("<username>:<personal_access_token>");

const options = {
  method: 'POST',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/json'
  },
  body: '{"email":"newhire@example.com","role":"employee"}'
};

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://{your_space_name}.signalwire.com/api/space/members"

	payload := strings.NewReader("{\n  \"email\": \"newhire@example.com\",\n  \"role\": \"employee\"\n}")

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

	req.SetBasicAuth("<username>", "<personal_access_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://{your_space_name}.signalwire.com/api/space/members")

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

request = Net::HTTP::Post.new(url)
request.basic_auth("<username>", "<personal_access_token>")
request["Content-Type"] = 'application/json'
request.body = "{\n  \"email\": \"newhire@example.com\",\n  \"role\": \"employee\"\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://{your_space_name}.signalwire.com/api/space/members")
  .basicAuth("<username>", "<personal_access_token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"email\": \"newhire@example.com\",\n  \"role\": \"employee\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://{your_space_name}.signalwire.com/api/space/members', [
  'body' => '{
  "email": "newhire@example.com",
  "role": "employee"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
    'auth' => ['<username>', '<personal_access_token>'],
]);

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

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://{your_space_name}.signalwire.com/api/space/members");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<personal_access_token>");
var request = new RestRequest(Method.POST);

request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"email\": \"newhire@example.com\",\n  \"role\": \"employee\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<username>:<personal_access_token>".utf8).base64EncodedString()

let headers = [
  "Authorization": "Basic \(credentials)",
  "Content-Type": "application/json"
]
let parameters = [
  "email": "newhire@example.com",
  "role": "employee"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://{your_space_name}.signalwire.com/api/space/members")! 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()
```