Create Sector
POST
/api/v1/sectors
const url = 'https://api.spartanauth.com/api/v1/sectors';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"name":"example","domain":"example","allowedOrigins":["example"],"slug":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.spartanauth.com/api/v1/sectors \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "domain": "example", "allowedOrigins": [ "example" ], "slug": "example" }'Creates a new sector with the specified name, domain, allowed origins, and slug. The slug is a unique identifier used in URLs and must be URL-safe (e.g. lowercase letters, numbers, hyphens).
Request Body
Section titled “Request Body ” Media type application/json
object
name
string
domain
string
allowedOrigins
Array<string>
slug
string
Example generated
{ "name": "example", "domain": "example", "allowedOrigins": [ "example" ], "slug": "example"}Responses
Section titled “ Responses ”A successful response.
Media type application/json
object
sectorID
string
name
string
domain
string
isDefault
boolean
allowedOrigins
Array<string>
slug
string
Example generated
{ "sectorID": "example", "name": "example", "domain": "example", "isDefault": true, "allowedOrigins": [ "example" ], "slug": "example"}default
Section titled “default ”An unexpected error response.
Media type application/json
object
code
integer format: int32
message
string
details
Array<object>
object
@type
string
key
additional properties
Example generated
{ "code": 1, "message": "example", "details": [ { "@type": "example" } ]}