> This page is for Developers.

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

# Accept user invitation

POST https://iot.telia.lt/api/v2/user/activation
Content-Type: application/json

Accepts a user invitation to join a Workspace.

The following fields may be provided:
- `activationKey` (String, required) - the JWT token received in the verification email
- `password` (String) - only mandatory if the user is invited to an organization without single sign-on (SSO) and doesn't have a password yet
- `name` (String) - name of the user


Reference: https://docs.iot.telia.lt/developers/api/workspaces/accept-user-invitation

## Authentication

- `Authorization` header (bearer token, required) — An `auth_token` should be provided to authenticate a session. To obtain an `auth_token`, see the [`/api/v1/authenticate` **POST** request](/developers/api/authentication/authenticate).

## Request

### Body (application/json)

This endpoint expects an object.

- `activationKey` (string, required)
- `password` (string, optional)
- `name` (string, optional)

## Response

### 204

User successfully accepted the invitation

## Errors

### 403 Forbidden Error

Forbidden

- `any`

## Examples

**Request**

```json
{
  "activationKey": "28fcfd949ee1bb79e7892b9",
  "password": "2fd4e1c87a2d20fced849ee7bb76e7391b93ee12",
  "name": "Tal Luka"
}
```

**SDK Code**

```python Workspaces_AcceptUserInvitation_example
import requests

url = "https://iot.telia.lt/api/v2/user/activation"

payload = {
    "activationKey": "28fcfd949ee1bb79e7892b9",
    "password": "2fd4e1c87a2d20fced849ee7bb76e7391b93ee12",
    "name": "Tal Luka"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Workspaces_AcceptUserInvitation_example
const url = 'https://iot.telia.lt/api/v2/user/activation';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"activationKey":"28fcfd949ee1bb79e7892b9","password":"2fd4e1c87a2d20fced849ee7bb76e7391b93ee12","name":"Tal Luka"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Workspaces_AcceptUserInvitation_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://iot.telia.lt/api/v2/user/activation"

	payload := strings.NewReader("{\n  \"activationKey\": \"28fcfd949ee1bb79e7892b9\",\n  \"password\": \"2fd4e1c87a2d20fced849ee7bb76e7391b93ee12\",\n  \"name\": \"Tal Luka\"\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 Workspaces_AcceptUserInvitation_example
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v2/user/activation")

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  \"activationKey\": \"28fcfd949ee1bb79e7892b9\",\n  \"password\": \"2fd4e1c87a2d20fced849ee7bb76e7391b93ee12\",\n  \"name\": \"Tal Luka\"\n}"

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

```java Workspaces_AcceptUserInvitation_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://iot.telia.lt/api/v2/user/activation")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"activationKey\": \"28fcfd949ee1bb79e7892b9\",\n  \"password\": \"2fd4e1c87a2d20fced849ee7bb76e7391b93ee12\",\n  \"name\": \"Tal Luka\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://iot.telia.lt/api/v2/user/activation', [
  'body' => '{
  "activationKey": "28fcfd949ee1bb79e7892b9",
  "password": "2fd4e1c87a2d20fced849ee7bb76e7391b93ee12",
  "name": "Tal Luka"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Workspaces_AcceptUserInvitation_example
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v2/user/activation");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"activationKey\": \"28fcfd949ee1bb79e7892b9\",\n  \"password\": \"2fd4e1c87a2d20fced849ee7bb76e7391b93ee12\",\n  \"name\": \"Tal Luka\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Workspaces_AcceptUserInvitation_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "activationKey": "28fcfd949ee1bb79e7892b9",
  "password": "2fd4e1c87a2d20fced849ee7bb76e7391b93ee12",
  "name": "Tal Luka"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v2/user/activation")! 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()
```