> For the complete documentation index, see [llms.txt](https://docs.shiftiq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shiftiq.com/developers/api-v2/navigating-the-api/accounts-api.md).

# Accounts API

## POST /api/accounts/cookies/login

>

```json
{"openapi":"3.0.1","info":{"title":"Developer API","version":"v2.0.0"},"servers":[{"url":"/v2/e01"}],"paths":{"/api/accounts/cookies/login":{"post":{"tags":["Accounts API"],"parameters":[{"name":"organizationCode","in":"query","schema":{"type":"string"}},{"name":"email","in":"query","schema":{"type":"string"}},{"name":"impersonatorOrganizationCode","in":"query","schema":{"type":"string"}},{"name":"impersonatorUserEmail","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CookieToken"}},"text/json":{"schema":{"$ref":"#/components/schemas/CookieToken"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}}}}}},"components":{"schemas":{"CookieToken":{"type":"object","properties":{"AuthenticationSource":{"type":"string","nullable":true},"Created":{"type":"string","nullable":true},"CurrentBrowser":{"type":"string","nullable":true},"CurrentBrowserVersion":{"type":"string","nullable":true},"CurrentOrganization":{"type":"string","nullable":true},"ID":{"type":"string","format":"uuid"},"ImpersonatorOrganization":{"type":"string","nullable":true},"ImpersonatorUser":{"type":"string","nullable":true},"IsAdministrator":{"type":"boolean"},"IsAuthenticated":{"type":"boolean","readOnly":true},"IsDeveloper":{"type":"boolean"},"IsOperator":{"type":"boolean"},"IsLearner":{"type":"boolean"},"Language":{"type":"string","nullable":true},"Modified":{"type":"string","nullable":true},"OrganizationCode":{"type":"string","nullable":true},"OrganizationIdentifier":{"type":"string","format":"uuid","nullable":true},"Session":{"type":"string","nullable":true},"TimeZoneId":{"type":"string","nullable":true},"UserEmail":{"type":"string","nullable":true},"UserIdentifier":{"type":"string","format":"uuid","nullable":true},"UserRoles":{"type":"array","items":{"type":"string"},"nullable":true},"ValidationKey":{"type":"string","nullable":true},"Environment":{"type":"string","nullable":true}},"additionalProperties":false}}}}
```

## POST /api/accounts/cookies/logout

>

```json
{"openapi":"3.0.1","info":{"title":"Developer API","version":"v2.0.0"},"servers":[{"url":"/v2/e01"}],"paths":{"/api/accounts/cookies/logout":{"post":{"tags":["Accounts API"],"responses":{"200":{"description":"OK"}}}}}}
```

Creates a new authentication cookie with the specified name and lifetime using the raw&#x20;\
request body as the cookie value.
---------------------------------

> In contrast to security/cookies/generate endpoint, this endpoint makes no assumptions about the request body.> \
> This means you can POST whatever cookie name and cookie value you want (encoded/escaped or not) and this method> \
> tries to create a new cookie for you. This is useful for testing the behaviour of the API when it receives> \
> unexpected (or corrupted) cookie tokens. Please note this endpoint is available in localhost environments only!

```json
{"openapi":"3.0.1","info":{"title":"Developer API","version":"v2.0.0"},"servers":[{"url":"/v2/e01"}],"paths":{"/api/accounts/cookies/create":{"post":{"tags":["Accounts API"],"summary":"Creates a new authentication cookie with the specified name and lifetime using the raw \r\nrequest body as the cookie value.","description":"In contrast to security/cookies/generate endpoint, this endpoint makes no assumptions about the request body.\r\nThis means you can POST whatever cookie name and cookie value you want (encoded/escaped or not) and this method\r\ntries to create a new cookie for you. This is useful for testing the behaviour of the API when it receives\r\nunexpected (or corrupted) cookie tokens. Please note this endpoint is available in localhost environments only!","parameters":[{"name":"name","in":"query","description":"The name of the cookie to create. If not provided, uses the default \r\n            cookie name from API configuration settings.","schema":{"type":"string"}},{"name":"lifetime","in":"query","description":"The lifetime of the cookie in seconds. If not provided, uses the \r\n            default lifetime from API configuration settings.","schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CookieValueResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/CookieValueResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}}}}}},"components":{"schemas":{"CookieValueResponse":{"type":"object","properties":{"Value":{"type":"string","nullable":true}},"additionalProperties":false}}}}
```

## POST /api/accounts/cookies/decode

> Decodes and deserializes a cookie token from the request body.

```json
{"openapi":"3.0.1","info":{"title":"Developer API","version":"v2.0.0"},"servers":[{"url":"/v2/e01"}],"paths":{"/api/accounts/cookies/decode":{"post":{"tags":["Accounts API"],"summary":"Decodes and deserializes a cookie token from the request body.","responses":{"200":{"description":"OK"}}}}}}
```

## POST /api/accounts/cookies/generate

> Generates a new authentication cookie using the provided token from the request body.

```json
{"openapi":"3.0.1","info":{"title":"Developer API","version":"v2.0.0"},"servers":[{"url":"/v2/e01"}],"paths":{"/api/accounts/cookies/generate":{"post":{"tags":["Accounts API"],"summary":"Generates a new authentication cookie using the provided token from the request body.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CookieGenerateResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/CookieGenerateResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}}}}}},"components":{"schemas":{"CookieGenerateResponse":{"type":"object","properties":{"Token":{"type":"string","nullable":true}},"additionalProperties":false}}}}
```

## GET /api/accounts/cookies/introspect

> Introspects the current authentication cookie and returns detailed information about the> \
> authentication and authorization status.

```json
{"openapi":"3.0.1","info":{"title":"Developer API","version":"v2.0.0"},"servers":[{"url":"/v2/e01"}],"security":[{"Cookie":[]}],"components":{"securitySchemes":{"Cookie":{"type":"apiKey","description":"-","name":"InSite.WebToken","in":"cookie"}}},"paths":{"/api/accounts/cookies/introspect":{"get":{"tags":["Accounts API"],"summary":"Introspects the current authentication cookie and returns detailed information about the\r\nauthentication and authorization status.","responses":{"200":{"description":"OK"}}}}}}
```

## POST /api/accounts/cookies/validate

> Validates a cookie token from the request body without setting it as an authentication&#x20;> \
> cookie.

```json
{"openapi":"3.0.1","info":{"title":"Developer API","version":"v2.0.0"},"servers":[{"url":"/v2/e01"}],"paths":{"/api/accounts/cookies/validate":{"post":{"tags":["Accounts API"],"summary":"Validates a cookie token from the request body without setting it as an authentication \r\ncookie.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CookieToken"}},"text/json":{"schema":{"$ref":"#/components/schemas/CookieToken"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}}}}}},"components":{"schemas":{"CookieToken":{"type":"object","properties":{"AuthenticationSource":{"type":"string","nullable":true},"Created":{"type":"string","nullable":true},"CurrentBrowser":{"type":"string","nullable":true},"CurrentBrowserVersion":{"type":"string","nullable":true},"CurrentOrganization":{"type":"string","nullable":true},"ID":{"type":"string","format":"uuid"},"ImpersonatorOrganization":{"type":"string","nullable":true},"ImpersonatorUser":{"type":"string","nullable":true},"IsAdministrator":{"type":"boolean"},"IsAuthenticated":{"type":"boolean","readOnly":true},"IsDeveloper":{"type":"boolean"},"IsOperator":{"type":"boolean"},"IsLearner":{"type":"boolean"},"Language":{"type":"string","nullable":true},"Modified":{"type":"string","nullable":true},"OrganizationCode":{"type":"string","nullable":true},"OrganizationIdentifier":{"type":"string","format":"uuid","nullable":true},"Session":{"type":"string","nullable":true},"TimeZoneId":{"type":"string","nullable":true},"UserEmail":{"type":"string","nullable":true},"UserIdentifier":{"type":"string","format":"uuid","nullable":true},"UserRoles":{"type":"array","items":{"type":"string"},"nullable":true},"ValidationKey":{"type":"string","nullable":true},"Environment":{"type":"string","nullable":true}},"additionalProperties":false}}}}
```

## POST /api/accounts/cookies/change-language/{language}

>

```json
{"openapi":"3.0.1","info":{"title":"Developer API","version":"v2.0.0"},"servers":[{"url":"/v2/e01"}],"security":[{"Bearer":[]},{"Cookie":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","description":"-","name":"Bearer","in":"header"},"Cookie":{"type":"apiKey","description":"-","name":"InSite.WebToken","in":"cookie"}}},"paths":{"/api/accounts/cookies/change-language/{language}":{"post":{"tags":["Accounts API"],"parameters":[{"name":"language","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}}}}
```

## POST /api/accounts/cookies/change-theme/{theme}

>

```json
{"openapi":"3.0.1","info":{"title":"Developer API","version":"v2.0.0"},"servers":[{"url":"/v2/e01"}],"security":[{"Bearer":[]},{"Cookie":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","description":"-","name":"Bearer","in":"header"},"Cookie":{"type":"apiKey","description":"-","name":"InSite.WebToken","in":"cookie"}}},"paths":{"/api/accounts/cookies/change-theme/{theme}":{"post":{"tags":["Accounts API"],"parameters":[{"name":"theme","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}}}}
```

## POST /api/accounts/cookies/refresh-session

>

```json
{"openapi":"3.0.1","info":{"title":"Developer API","version":"v2.0.0"},"servers":[{"url":"/v2/e01"}],"security":[{"Bearer":[]},{"Cookie":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","description":"-","name":"Bearer","in":"header"},"Cookie":{"type":"apiKey","description":"-","name":"InSite.WebToken","in":"cookie"}}},"paths":{"/api/accounts/cookies/refresh-session":{"post":{"tags":["Accounts API"],"responses":{"200":{"description":"OK"}}}}}}
```

## POST /api/accounts/passwords/hash

>

```json
{"openapi":"3.0.1","info":{"title":"Developer API","version":"v2.0.0"},"servers":[{"url":"/v2/e01"}],"paths":{"/api/accounts/passwords/hash":{"post":{"tags":["Accounts API"],"operationId":"generatePasswordHash","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordHashResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/PasswordHashResponse"}}}}}}}},"components":{"schemas":{"PasswordHashResponse":{"type":"object","properties":{"Hash":{"type":"string","nullable":true}},"additionalProperties":false}}}}
```

## POST /api/accounts/secrets/generate

> Generates a new client secret for the authenticated user, replacing any existing secret.

```json
{"openapi":"3.0.1","info":{"title":"Developer API","version":"v2.0.0"},"servers":[{"url":"/v2/e01"}],"security":[{"Bearer":[]},{"Cookie":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","description":"-","name":"Bearer","in":"header"},"Cookie":{"type":"apiKey","description":"-","name":"InSite.WebToken","in":"cookie"}},"schemas":{"PersonSecretModel":{"type":"object","properties":{"PersonId":{"type":"string","format":"uuid"},"SecretId":{"type":"string","format":"uuid"},"SecretName":{"type":"string","nullable":true},"SecretType":{"type":"string","nullable":true},"SecretValue":{"type":"string","nullable":true},"SecretLifetimeLimit":{"type":"integer","format":"int32","nullable":true},"SecretExpiry":{"type":"string","format":"date-time"}},"additionalProperties":false}}},"paths":{"/api/accounts/secrets/generate":{"post":{"tags":["Accounts API"],"summary":"Generates a new client secret for the authenticated user, replacing any existing secret.","operationId":"generateSecret","parameters":[{"name":"expiry","in":"query","description":"The number of days until the secret expires. If omitted, the default is assumed (90 days).","schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonSecretModel"}},"text/json":{"schema":{"$ref":"#/components/schemas/PersonSecretModel"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}}}}}}}
```

## GET /api/accounts/secrets/introspect

>

```json
{"openapi":"3.0.1","info":{"title":"Developer API","version":"v2.0.0"},"servers":[{"url":"/v2/e01"}],"security":[{"Secret":[]}],"components":{"securitySchemes":{"Secret":{"type":"apiKey","description":"-","name":"Secret","in":"header"}}},"paths":{"/api/accounts/secrets/introspect":{"get":{"tags":["Accounts API"],"operationId":"introspectSecret","responses":{"200":{"description":"OK"}}}}}}
```

## POST /api/accounts/tokens/generate

>

```json
{"openapi":"3.0.1","info":{"title":"Developer API","version":"v2.0.0"},"servers":[{"url":"/v2/e01"}],"paths":{"/api/accounts/tokens/generate":{"post":{"tags":["Accounts API"],"requestBody":{"content":{"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/JwtRequest"}},"application/json":{"schema":{"$ref":"#/components/schemas/JwtRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/JwtRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/JwtRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JwtResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/JwtResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}}}}}},"components":{"schemas":{"JwtRequest":{"type":"object","properties":{"Debug":{"type":"boolean"},"Paging":{"type":"boolean"},"Secret":{"type":"string","nullable":true},"Lifetime":{"type":"integer","format":"int32","nullable":true},"Organization":{"type":"string","format":"uuid","nullable":true},"Agent":{"type":"string","format":"uuid","nullable":true},"Subject":{"type":"string","format":"uuid","nullable":true}},"additionalProperties":false},"JwtResponse":{"type":"object","properties":{"AccessToken":{"type":"string","nullable":true},"TokenType":{"type":"string","nullable":true},"ExpiresIn":{"type":"integer","format":"int32"},"Lifetime":{"type":"string","nullable":true},"Paging":{"type":"string","nullable":true}},"additionalProperties":false}}}}
```

## POST /api/security/tokens/generate

>

```json
{"openapi":"3.0.1","info":{"title":"Developer API","version":"v2.0.0"},"servers":[{"url":"/v2/e01"}],"paths":{"/api/security/tokens/generate":{"post":{"tags":["Accounts API"],"requestBody":{"content":{"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/JwtRequest"}},"application/json":{"schema":{"$ref":"#/components/schemas/JwtRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/JwtRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/JwtRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JwtResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/JwtResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}}}}}},"components":{"schemas":{"JwtRequest":{"type":"object","properties":{"Debug":{"type":"boolean"},"Paging":{"type":"boolean"},"Secret":{"type":"string","nullable":true},"Lifetime":{"type":"integer","format":"int32","nullable":true},"Organization":{"type":"string","format":"uuid","nullable":true},"Agent":{"type":"string","format":"uuid","nullable":true},"Subject":{"type":"string","format":"uuid","nullable":true}},"additionalProperties":false},"JwtResponse":{"type":"object","properties":{"AccessToken":{"type":"string","nullable":true},"TokenType":{"type":"string","nullable":true},"ExpiresIn":{"type":"integer","format":"int32"},"Lifetime":{"type":"string","nullable":true},"Paging":{"type":"string","nullable":true}},"additionalProperties":false}}}}
```

## GET /api/accounts/tokens/introspect

>

```json
{"openapi":"3.0.1","info":{"title":"Developer API","version":"v2.0.0"},"servers":[{"url":"/v2/e01"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","description":"-","name":"Bearer","in":"header"}},"schemas":{"JwtIntrospectResponse":{"type":"object","properties":{"Jwt":{"nullable":true},"Principal":{"nullable":true}},"additionalProperties":false}}},"paths":{"/api/accounts/tokens/introspect":{"get":{"tags":["Accounts API"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JwtIntrospectResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/JwtIntrospectResponse"}}}}}}}}}
```

## POST /api/accounts/tokens/validate

>

```json
{"openapi":"3.0.1","info":{"title":"Developer API","version":"v2.0.0"},"servers":[{"url":"/v2/e01"}],"paths":{"/api/accounts/tokens/validate":{"post":{"tags":["Accounts API"],"requestBody":{"content":{"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/ValidateInput"}},"application/json":{"schema":{"$ref":"#/components/schemas/ValidateInput"}},"text/json":{"schema":{"$ref":"#/components/schemas/ValidateInput"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/ValidateInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JwtValidateResult"}},"text/json":{"schema":{"$ref":"#/components/schemas/JwtValidateResult"}}}}}}}},"components":{"schemas":{"ValidateInput":{"type":"object","properties":{"Token":{"type":"string","nullable":true}},"additionalProperties":false},"JwtValidateResult":{"type":"object","properties":{"Subject":{"type":"string","nullable":true},"SignatureVerification":{"type":"string","nullable":true},"ExpiryVerification":{"type":"string","nullable":true},"AudienceVerification":{"type":"string","nullable":true},"IssuerVerification":{"type":"string","nullable":true}},"additionalProperties":false}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.shiftiq.com/developers/api-v2/navigating-the-api/accounts-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
