# 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":{"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}}}}}}}
```

## 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":{"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}}}}}}}
```

## 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":{"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}}}}}}}
```

## 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":{"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}}}}}}}
```

## 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"}}},"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":{"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":{"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}}}}
```

## 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"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JwtValidateResult"}},"text/json":{"schema":{"$ref":"#/components/schemas/JwtValidateResult"}}}}}}}},"components":{"schemas":{"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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
