**GETTING STARTED GUIDE**

# Using Securin API Documentation

A practical path from opening the reference to making a successful first request

This guide covers initial App setup, App authentication, token renewal, and a read-only first request.

## What You’ll Learn

- How the API documentation is organized and where to start.
- How to interpret an endpoint page, including parameters, request bodies, responses, and errors.
- How to obtain App credentials, choose an environment, and make a safe first request.
- How to troubleshoot common problems and find the right support path.


*Audience: developers, technical partners, solution consultants, and anyone evaluating or integrating with the API.*

## 1. Before You Begin

Set yourself up for a quick, low-risk first session. You should have:

- Access to the [Securin API documentation](https://docs.securin.io/) and an authorized Securin Platform account.
- Your account ID and access to an App configured with the required roles and workspace access. If you need an App, use the setup steps below or ask your account administrator to arrange setup.
- A tool for sending HTTP requests, such as cURL, Postman, or your preferred API client.
- A safe place to store secrets. Never paste client secrets, tokens, passwords, or API keys into tickets, chat messages, source control, or shared documents.


> **THE API FAMILY** The public Platform API reference uses `https://platformapi.securin.io`.


## 2. Know the Documentation Layout

| **Section** | **What to look for** |
|  --- | --- |
| **Overview** | Concepts, supported use cases, terminology, limits, and the recommended integration path. |
| **Authentication** | How credentials are issued, how requests are authorized, and how credentials and tokens are renewed or rotated. |
| **API reference** | Endpoint-by-endpoint details: method, path, parameters, body schema, responses, and examples. |
| **Data models** | Reusable object definitions, field types, required properties, enumerations, and relationships. |
| **Errors** | Status codes, error payloads, retry guidance, validation messages, and trace identifiers. |


## 3. Read an Endpoint Page

Treat each endpoint page as a contract. Before copying an example, check each part below.

| **Page element** | **Questions to answer** |
|  --- | --- |
| **Method + path** | What action and resource does the endpoint represent? Confirm the path and API version. |
| **Authentication** | Which credential type, roles, scopes, or permissions are required? |
| **Path parameters** | Which values are embedded in the URL, such as an account ID? |
| **Query parameters** | Which filters, pagination, sorting, or optional behavior are supported? |
| **Request headers** | Which authentication, content-type, and operation-specific headers must you send? |
| **Request body** | Which fields are required, and what constraints apply? |
| **Response** | What success status, body schema, pagination metadata, and response headers should you expect? |
| **Errors** | Should a failed request be corrected, retried, or escalated? |


> **SCHEMA TIP** Check formats, allowed values, length limits, nullability, and how unknown fields are handled.


### Example: Interpret Before You Run

```http
GET https://platformapi.securin.io/account-service/api/v1/accounts/{account-id}/workspaces
Authorization: Bearer <access_token>
Accept: application/json
```

- Replace `{account-id}` and `<access_token>` with authorized values; do not send the placeholder brackets.
- This workspace-list operation is read-only. Other operations can require different headers, parameters, or permissions.
- You do not need to send `x-user-id`. The platform adds it after successful authentication, even where an endpoint reference lists it as mandatory.


## 4. Make Your First Request

Use the workspace-list operation as a read-only connectivity check after obtaining an access token for the target account.

### Step 1 — Confirm the environment

For the Platform APIs documented at docs.securin.io, use `https://platformapi.securin.io`. Confirm that your credentials and data belong to the intended account and environment.

### Step 2 — Set up an App and obtain an OAuth2 access token

For an integration that runs automatically, such as a scheduled job or background service, use an App configured for API access in the target account. An App is a registered integration identity with its own Client ID, Client Secret, roles, and workspace access.

A person can perform the initial setup. The integration then uses the App credentials for ongoing authentication rather than storing a person’s password.

> **APP CREDENTIALS AND CONNECTOR CREDENTIALS** App credentials identify an integration when it calls Securin APIs. The separate Credentials API stores authentication details for connectors to services such as Tenable, GitHub, and Jira. Creating a connector credential returns a `credentialId`; it does not create a Securin App or issue its Client ID and Client Secret. Its OAuth token-generation operation exchanges an authorization code and stores tokens for connectors. Use the Login API to obtain and renew a Securin App access token.


#### A. Obtain the App credentials through the platform interface

Of the Securin-defined roles, **Administrator** is the only predefined role that can create Apps. Users assigned a custom role with the **Create Apps** permission can also create Apps. If you do not have this permission, ask your account administrator to arrange setup.

1. Sign in to the Securin platform and navigate to **Admin → Identity & Access → Apps (API Access)**.
2. Click **Create App**.
3. Enter the App name and, optionally, a description.
4. Select the roles and workspaces the integration needs. Review the effective access and permissions before saving.
5. Click **Save**. The platform displays the generated Client ID and Client Secret.
6. Store the credentials securely for use by the integration.


See the [App creation walkthrough](https://securin-documentation.zoholearn.in/m/platform-documentation/a/create-an-app-for-api-access).

#### Alternative: create an App through the API

If you already have an authorized Bearer token and permission to create Apps in the target account, use:

```http
POST https://platformapi.securin.io/account-service/api/v1/accounts/{account-id}/apps
Authorization: Bearer <existing_access_token>
Content-Type: application/json
```

The Create App operation requires an existing Bearer JWT belonging to a user or App with permission to create Apps in the target account. You can obtain a user token through the Login API using the credentials of an authorized user, or use a token obtained with an existing App's credentials if that App has the required permission. The credentials of the new App are available only after it has been created.

For initial API setup with an authorized user, securely set `SECURIN_USERNAME` and `SECURIN_PASSWORD`, then request a user access token:

```bash
curl --request POST \
  --url "https://platformapi.securin.io/account-service/api/v1/oauth2/token" \
  --header "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "username=${SECURIN_USERNAME}" \
  --data-urlencode "password=${SECURIN_PASSWORD}"
```

Use the returned `access_token` as `<existing_access_token>` in the Create App request, with the JSON body described below. After creating the App, use its credentials for the automated integration.

The request requires `name` and a nonempty `accounts` array. Each account entry requires a nonempty `roleIds` array. The schema also documents account identifiers, account scope, and workspace IDs. Use real, authorized values rather than generated placeholder IDs. Consult the [Create App reference](https://docs.securin.io/panther-services/apidef/apis/public/apps/apps/createapp) for the complete schema.

The successful response returns `status`, `message`, `clientId`, and `clientSecret`. Map the returned credential values to the token request parameters as follows:

| **Create App response field** | **Token request parameter** |
|  --- | --- |
| `clientId` | `client_id` |
| `clientSecret` | `client_secret` |


#### B. Exchange the App credentials for an access token

The OAuth2 client credentials flow lets an integration authenticate using its App credentials. This guide focuses on App authentication; user-login and refresh-token flows should follow their separate documentation.

Set `SECURIN_CLIENT_ID` and `SECURIN_CLIENT_SECRET` securely in your local environment before running the example. The commands in this guide use Bash syntax; adapt them to your shell or API client.

```bash
BASE_URL="https://platformapi.securin.io"
TOKEN_URL="${BASE_URL}/account-service/api/v1/oauth2/token"

curl --request POST \
  --url "${TOKEN_URL}" \
  --header "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "client_id=${SECURIN_CLIENT_ID}" \
  --data-urlencode "client_secret=${SECURIN_CLIENT_SECRET}"
```

Send the App credentials as form-encoded `client_id` and `client_secret`, as shown in the Login endpoint schema and the published authentication walkthrough.

An illustrative App token response excerpt is:

```json
{
  "access_token": "<access_token>",
  "token_type": "Bearer",
  "expires_in": 86400
}
```

This is an excerpt, not the complete response schema. The [published authentication walkthrough](https://securin-documentation.zoholearn.in/m/platform-documentation/a/authenticate-and-access-apis) states that App access tokens are valid for 24 hours, matching `expires_in: 86400`. Use the actual `expires_in` value returned by the service to schedule renewal rather than hard-coding 24 hours. This example reflects the reviewers' clarification that App responses do not include refresh-token fields.

Store `access_token` securely as `SECURIN_ACCESS_TOKEN` for the next step. Before it expires, obtain a replacement by repeating the App credentials token request, allowing a small timing margin. Use the new token for subsequent requests. Obtaining a new token does not invalidate the previous token: the platform uses stateless JWTs, and the previous token remains valid until its own expiry.

> **APP TOKEN LIFECYCLE** Apps do not receive a refresh token or `refresh_expires_in`. Only user-token responses include `refresh_token` and `refresh_expires_in`. For Apps, track `expires_in` and repeat the App credentials request to obtain a new access token. Refresh-token guidance in a shared Login response schema applies to user authentication, not App authentication.


### Step 3 — Send the request

Set `SECURIN_ACCOUNT_ID` to the authorized target account. Send the access token in the Authorization header. The platform adds `x-user-id` after successful authentication; your integration does not need to supply it.

```bash
BASE_URL="https://platformapi.securin.io"
ACCOUNT_PATH="/account-service/api/v1/accounts/${SECURIN_ACCOUNT_ID}"
WORKSPACES_URL="${BASE_URL}${ACCOUNT_PATH}/workspaces"

curl --request GET \
  --dump-header - \
  --url "${WORKSPACES_URL}" \
  --header "Authorization: Bearer ${SECURIN_ACCESS_TOKEN}" \
  --header "Accept: application/json"
```

### Step 4 — Check the result

- The HTTP status matches the documented success status.
- The response body matches the documented schema.
- Identifiers, timestamps, pagination, and optional fields behave as described.
- No credentials or sensitive data appear in shared logs, screenshots, or copied examples.
- The `X-Trace-ID` response header is retained when returned. Error bodies may also contain the same identifier as `traceId`.


#### Capture the trace ID for support

Capture the correlation ID from the `X-Trace-ID` response header. Error responses may also include the same value in the JSON body as `traceId`. Retain the identifier with the timestamp, endpoint method and path, and HTTP status when contacting support.

The [Login reference](https://docs.securin.io/panther-services/apidef/apis/public/login/login/login), [Create Credential reference](https://docs.securin.io/panther-services/apidef/apis/public/credentials/credentials/createcredential), and [workspace-list reference](https://docs.securin.io/panther-services/apidef/apis/public/workspaces/workspaces/getworkspacesbyaccountid) document this convention in several error-response definitions, including 401, 403, and 429. Their header descriptions state that the header is present on every response and matches the JSON body field `traceId`; the body field is described as usually present. Capture the header when returned and the body identifier when available. This guidance is supported for the APIs used in this walkthrough; consult other endpoint references for operation-specific behavior. These references do not establish a requirement to send a trace ID in the request.

The cURL example uses `--dump-header -` to display response headers alongside the body during local troubleshooting. Sanitize this output before sharing it.

### Step 5 — Turn the example into application code

Once the manual request works, reproduce it in your application using a maintained HTTP library or an official SDK, if available. Add timeouts, safe logging, structured error handling, and tests before expanding the integration.

> **SUCCESS MEANS** You can repeat the request, explain every input and output field you depend on, and identify what your application will do when the API returns an error.


## 5. Authentication, environments, and safety

### Platform API Credentials

- Treat access tokens, refresh tokens, client secrets, and passwords as secrets.
- For scheduled jobs and background services, use an App with the required roles and workspace access. Authenticate using its Client ID and Client Secret rather than storing a person’s password.
- Send the access token as `Authorization: Bearer <access_token>` on protected Platform API requests.
- For App authentication, track `expires_in` and obtain a new access token using the App credentials before the current token expires. Apps do not receive `refresh_token` or `refresh_expires_in`.
- Obtaining a new access token does not invalidate the old token; each remains valid until its own expiry.
- For user authentication, follow the documented refresh-token flow and track `refresh_expires_in` as well as access-token expiry.
- You do not need to send `x-user-id`; the platform adds it after successful authentication.
- Keep secrets out of source code, URLs, client-side applications, and shared logs.
- Revoke or rotate exposed application credentials and tokens according to your organization’s incident process.


### Environment Checklist

| **Check** | **Confirm before sending** |
|  --- | --- |
| **Base URL** | Is the public Platform request using `https://platformapi.securin.io`? |
| **Credential** | Was the token issued for the intended identity, account access, and environment? |
| **Headers** | Have you included `Authorization` and any required content-type or operation-specific headers? The platform adds `x-user-id` after authentication. |
| **Data** | Is the payload approved for use in that environment? |
| **Limits** | Are rate, concurrency, or quota limits different by environment? |


### Postman Quick Start

Securin’s API is described using OpenAPI 3.0. Securin publishes a [combined Platform API collection](https://docs.securin.io/postman) and individual service collections. Import the collection, set its base URL to `https://platformapi.securin.io`, and provide an active Bearer token. Review every request before sending it.

> **COLLECTION VARIABLE NOTE** The original guide notes that the download page refers to `accessToken`, while some generated requests reference `bearerToken`. If authentication is not applied after import, align the collection variable name with the variable used by the request.


### Performance and Pagination

The generated collections commonly use `limit` and `next`; some services use `page`. Follow the parameters and stopping conditions documented for the specific operation. Do not assume `next` is always an opaque cursor: both the Apps list and workspace-list references describe it as a page number. Workspace listing defaults to `next=1` and `limit=10`; its response includes `workspaces`, `next`, and `totalRecords`.

> **DEVELOPER GUIDANCE** The original guide’s internal developer guidance recommends 50 records per page and states a maximum of 100 through `limit`. Apply these values only where supported by the operation. Fetch pages sequentially using its documented pagination behavior; avoid parallel bursts that can create concurrency bottlenecks or trigger `429` responses.


### Versioning and Change Management

Consult the changelog and deprecation policy where available. Record the API version in your integration documentation, subscribe to change notifications if available, and validate changes in an approved test environment before production rollout.

## 6. Troubleshoot common problems — error messages

| **Symptom** | **What to check** |
|  --- | --- |
| **401 Unauthorized** | Check token expiry, the authentication header and scheme, the base URL, and the validity of the credentials. Obtaining another access token does not invalidate an unexpired token. |
| **403 Forbidden** | Confirm roles, scopes, workspace access, resource ownership, account state, and endpoint permissions. |
| **404 Not Found** | Verify the base URL, API version, path, resource ID, and whether the resource exists in this environment. |
| **409 Conflict** | Look for duplicate operations, state conflicts, or an idempotency requirement. |
| **422 / validation error** | Compare field names, types, formats, required values, and allowed enumerations with the schema. |
| **429 Too Many Requests** | Reduce concurrency, honor retry guidance and rate-limit headers, and use backoff with jitter instead of immediate loops. |
| **5xx server error** | Retry only when documented and safe. Retain the timestamp, `X-Trace-ID` if returned, endpoint, and sanitized context for support. |


## 7. Build from a Working Request

After the first request succeeds, expand deliberately:

- Add pagination and filtering.
- Handle every documented response class, not only the happy path.
- Add timeouts and bounded retries for safe, retryable operations.
- Use idempotency controls for create or other state-changing operations when supported.
- Capture metrics and `X-Trace-ID` when returned, alongside sanitized request context.
- Test token expiry, invalid or revoked credentials, malformed input, rate limits, and partial failures.
- Review the production-readiness checklist with the service owner.


### When Asking for Support

Provide enough detail to reproduce the problem without exposing secrets or personal data:

- Environment and API version.
- Endpoint method and path.
- Timestamp with time zone.
- HTTP status and sanitized error body.
- The returned `X-Trace-ID` header value or `traceId` error-body value, if available. See Step 4 for the documented Login, Credentials, and workspace-list behavior.
- What you expected, what happened, and whether the problem is repeatable.
- For authentication issues, contact `support@securin.io` after removing credentials and tokens from all evidence.


## 8. Securin Configuration Summary

Use this summary alongside the endpoint reference and the authentication guidance above.

| **Setting** | **Value or guidance** |
|  --- | --- |
| **API reference** | `https://docs.securin.io/` |
| **Platform base URL** | `https://platformapi.securin.io` |
| **Initial App setup** | Admin → Identity & Access → Apps (API Access) |
| **Create App endpoint** | `POST /account-service/api/v1/accounts/{account-id}/apps` |
| **Create App authentication** | Bearer JWT belonging to a user or App with permission to create Apps in the target account |
| **Credential field mapping** | `clientId` → `client_id`; `clientSecret` → `client_secret` |
| **OAuth2 token endpoint** | `POST /account-service/api/v1/oauth2/token` |
| **App token request** | Form-encoded `client_id` and `client_secret`; the documented request omits `grant_type` |
| **App token lifetime** | Walkthrough states 24 hours; use the returned `expires_in` value for renewal |
| **App token renewal** | Repeat the App credentials token request before expiry; the previous token remains valid until its own expiry |
| **Refresh-token fields** | User-token responses only; App responses do not include `refresh_token` or `refresh_expires_in` |
| **Authentication header** | `Authorization: Bearer <access_token>` |
| **Starter request** | `GET /account-service/api/v1/accounts/{account-id}/workspaces` |
| **Starter headers** | `Authorization`, `Accept`; the platform adds `x-user-id` after successful authentication |
| **Support trace identifier** | Login, Credentials, and workspace listing document response header `X-Trace-ID` and error-body field `traceId` |
| **Page-size guidance** | Original internal guidance: 50 recommended, 100 maximum; follow operation-specific limits |
| **Pagination strategy** | Fetch sequentially; follow the operation’s definition of `next` or `page` |
| **Support** | `support@securin.io` |


### Related Securin Documentation

- [Workspace-list endpoint reference](https://docs.securin.io/panther-services/apidef/apis/public/workspaces/workspaces/getworkspacesbyaccountid)
- [Credentials API: connector credential management](https://docs.securin.io/panther-services/apidef/apis/public/credentials/credentials)
- [Create Credential endpoint reference](https://docs.securin.io/panther-services/apidef/apis/public/credentials/credentials/createcredential)
- [Generate OAuth tokens for connectors](https://docs.securin.io/panther-services/apidef/apis/public/credentials/credentials/generateoauthauthorizetoken)
- [Securin API documentation](https://docs.securin.io/)
- [Create App endpoint reference](https://docs.securin.io/panther-services/apidef/apis/public/apps/apps/createapp)
- [Login API overview](https://docs.securin.io/panther-services/apidef/apis/public/login)
- [Login endpoint reference](https://docs.securin.io/panther-services/apidef/apis/public/login/login/login)
- [Postman collections](https://docs.securin.io/postman)
- [Create an App for API access](https://securin-documentation.zoholearn.in/m/platform-documentation/a/create-an-app-for-api-access)
- [Authenticate and access APIs](https://securin-documentation.zoholearn.in/m/platform-documentation/a/authenticate-and-access-apis)