> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreflux.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Okta

> Client-mode REST API connector for a curated Okta Users API slice: list users and create a user

Technical Preview

# Okta

Client-mode REST API connector for a curated Okta Users API slice: list users and create a user.

* Hub category: **Identity**.
* Base: `https://tenant.okta.com`

## Template reference

Generated from the shipped broker template `okta` (`-routeCode OKTA`). It lists every event the template defines.

### Auth

Auth headers used by the template: `Authorization: SSWS {value.json.api_token}`.

### Template parameters

| Placeholder | Type | Description | Required |
| - | - | - | - |
| `RouteName` | string | Name of the Okta connector | no |
| `BaseUrl` | string | Okta base URL without trailing slash (e.g. [https://tenant.okta.com](https://tenant.okta.com)) | yes |

`BASE_ADDRESS` default: `https://tenant.okta.com`.

### Events

| Event | Method | Endpoint | Request topic | Response topic | Payload fields |
| - | - | - | - | - | - |
| `Listusers` | GET | `/api/v1/users` | `identity/okta/users/list` | `identity/okta/users/list/response` | `api_token` |
| `Createuser` | POST | `/api/v1/users` | `identity/okta/users/create` | `identity/okta/users/create/response` | `api_token`, `body` |
| `Getuser` | GET | `/api/v1/users/{value.json.user_id}` | `identity/okta/users/get` | `identity/okta/users/get/response` | `api_token`, `user_id` |

### Deploy

Get the template card (JSON with `template` and `metadata`) from the broker, then deploy the connector:

```bash theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
mosquitto_pub -t '$SYS/Coreflux/Command' -m "-routeCode OKTA"
```

The deployable connector from the REST API app, with `BASE_ADDRESS` already filled in:

```lot theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
DEFINE ROUTE OktaRestApi WITH TYPE REST_API
    ADD REST_API_CONFIG
        WITH BASE_ADDRESS "https://tenant.okta.com"
        WITH ENABLE_CLIENT "true"
        WITH USE_SSL "true"
        WITH REQUEST_TIMEOUT '60'
        WITH DEFAULT_CONTENT_TYPE "application/json"
    ADD EVENT Listusers
        WITH SOURCE_TOPIC "identity/okta/users/list"
        WITH DESTINATION_TOPIC "identity/okta/users/list/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/api/v1/users"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "SSWS {value.json.api_token}"
    ADD EVENT Createuser
        WITH SOURCE_TOPIC "identity/okta/users/create"
        WITH DESTINATION_TOPIC "identity/okta/users/create/response"
        WITH METHOD "POST"
        WITH ENDPOINT "/api/v1/users"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Content-Type" "application/json"
            ADD "Authorization" "SSWS {value.json.api_token}"
        WITH BODY "{value.json.body}"
    ADD EVENT Getuser
        WITH SOURCE_TOPIC "identity/okta/users/get"
        WITH DESTINATION_TOPIC "identity/okta/users/get/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/api/v1/users/{value.json.user_id}"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "SSWS {value.json.api_token}"
```

Deploy it with `-addRoute` (do not include `ADD METADATA`).

### Usage example

Call `Listusers` by publishing a JSON payload to its request topic, and read the reply on the response topic:

```bash theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
mosquitto_sub -t 'identity/okta/users/list/response' &
mosquitto_pub -t 'identity/okta/users/list' -m '{"api_token": "<api_token>"}'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.