# Devices

## Get all registered devices

> Returns all devices associated with the tenant, including their configuration and status.\
> \
> \## Authorization\
> Requires \`Device.Read\` scope.\
> \
> \## Pagination\
> Currently returns all devices. Pagination may be added in future versions if needed.\
> \
> \## Use Cases\
> \- Device inventory management\
> \- Configuration deployment\
> \- Status monitoring

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Devices"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["ScopedAuthorizeRequirement"]},{"apiKey":["ScopedAuthorizeRequirement"]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"Device":{"type":"object","properties":{"deviceId":{"type":["null","string"],"description":"Unique device identifier."},"name":{"type":["null","string"],"description":"Device name."},"description":{"type":["null","string"],"description":"Optional description."},"isEnabled":{"type":"boolean","description":"Whether the device is currently active."},"type":{"$ref":"#/components/schemas/DeviceType"},"settings":{"type":"null","oneOf":[{"$ref":"#/components/schemas/CrewCheckSettings"}],"description":"Type-specific settings."}},"additionalProperties":false,"description":"Device metadata exposed by the API."},"DeviceType":{"enum":["CrewCheck"],"type":"string"},"CrewCheckSettings":{"required":["logoUrl"],"type":"object","allOf":[{"$ref":"#/components/schemas/DeviceSettingsBase"}],"properties":{"logoUrl":{"type":["null","string"],"description":"URL of the logo to display on the CrewCheck device."}},"additionalProperties":false},"DeviceSettingsBase":{"type":"object","additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":["null","object"],"additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/devices":{"get":{"tags":["Devices"],"summary":"Get all registered devices","description":"Returns all devices associated with the tenant, including their configuration and status.\n\n## Authorization\nRequires `Device.Read` scope.\n\n## Pagination\nCurrently returns all devices. Pagination may be added in future versions if needed.\n\n## Use Cases\n- Device inventory management\n- Configuration deployment\n- Status monitoring","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"List of all devices","content":{"text/plain":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Device"}}},"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Device"}}},"text/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Device"}}}}},"401":{"description":"Not authorized","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"500":{"description":"Internal server error while listing devices"}}}}}}
```

## Create a new device of the specified type.

> Creates a new device with the specified type and configuration. Currently supports CrewCheck device type with logo URL configuration.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Devices"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["ScopedAuthorizeRequirement"]},{"apiKey":["ScopedAuthorizeRequirement"]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"CreateDevice":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/DeviceType"},"name":{"type":["null","string"],"description":"Device name."},"description":{"type":["null","string"],"description":"Optional device description."}},"additionalProperties":false,"description":"Payload to create a new device."},"DeviceType":{"enum":["CrewCheck"],"type":"string"},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":["null","object"],"additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/devices":{"post":{"tags":["Devices"],"summary":"Create a new device of the specified type.","description":"Creates a new device with the specified type and configuration. Currently supports CrewCheck device type with logo URL configuration.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Device type and description.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDevice"}},"text/json":{"schema":{"$ref":"#/components/schemas/CreateDevice"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/CreateDevice"}}}},"responses":{"201":{"description":"Device created successfully"},"401":{"description":"Not authorized","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"500":{"description":"Internal server error while creating device"}}}}}}
```

## Retrieve a device by id.

> Returns detailed information about a specific device including its type and configuration settings.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Devices"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["ScopedAuthorizeRequirement"]},{"apiKey":["ScopedAuthorizeRequirement"]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":["null","object"],"additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/devices/{deviceId}":{"get":{"tags":["Devices"],"summary":"Retrieve a device by id.","description":"Returns detailed information about a specific device including its type and configuration settings.","operationId":"Get","parameters":[{"name":"deviceId","in":"path","description":"Device identifier.","required":true,"schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Device details"},"401":{"description":"Not authorized","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"Device not found","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"500":{"description":"Internal server error while retrieving device"}}}}}}
```

## Update a device.

> Updates name, description, and enabled status.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Devices"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["ScopedAuthorizeRequirement"]},{"apiKey":["ScopedAuthorizeRequirement"]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"UpdateDevice":{"type":"object","properties":{"name":{"type":["null","string"],"description":"Device name."},"description":{"type":["null","string"],"description":"Optional description."},"isEnabled":{"type":"boolean","description":"Whether the device should be enabled."}},"additionalProperties":false,"description":"Payload to update a device."},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":["null","object"],"additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/devices/{deviceId}":{"put":{"tags":["Devices"],"summary":"Update a device.","description":"Updates name, description, and enabled status.","parameters":[{"name":"deviceId","in":"path","description":"Device identifier.","required":true,"schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Update payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDevice"}},"text/json":{"schema":{"$ref":"#/components/schemas/UpdateDevice"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/UpdateDevice"}}}},"responses":{"200":{"description":"Device updated successfully"},"401":{"description":"Not authorized","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"Device not found","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"500":{"description":"Internal server error while updating device"}}}}}}
```

## Delete a device and revoke its API key.

> Removes the device from the system and invalidates any associated API keys. This prevents the device from authenticating to the system.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Devices"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["ScopedAuthorizeRequirement"]},{"apiKey":["ScopedAuthorizeRequirement"]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":["null","object"],"additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/devices/{deviceId}":{"delete":{"tags":["Devices"],"summary":"Delete a device and revoke its API key.","description":"Removes the device from the system and invalidates any associated API keys. This prevents the device from authenticating to the system.","parameters":[{"name":"deviceId","in":"path","description":"Device identifier.","required":true,"schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Device deletion accepted"},"401":{"description":"Not authorized","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"500":{"description":"Internal server error while deleting device"}}}}}}
```

## Connect a device using its API key and return device settings.

> Establishes a connection for the device and returns its current configuration settings. This endpoint verifies the device's authorization before allowing the connection.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Devices"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["ScopedAuthorizeRequirement"]},{"apiKey":["ScopedAuthorizeRequirement"]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"ConnectResponse":{"type":"object","properties":{"settings":{"type":"null","oneOf":[{"$ref":"#/components/schemas/CrewCheckSettings"}],"description":"Settings related to the connected device"}},"additionalProperties":false,"description":"Connect result information"},"CrewCheckSettings":{"required":["logoUrl"],"type":"object","allOf":[{"$ref":"#/components/schemas/DeviceSettingsBase"}],"properties":{"logoUrl":{"type":["null","string"],"description":"URL of the logo to display on the CrewCheck device."}},"additionalProperties":false},"DeviceSettingsBase":{"type":"object","additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":["null","object"],"additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/devices/{deviceId}/connect":{"post":{"tags":["Devices"],"summary":"Connect a device using its API key and return device settings.","description":"Establishes a connection for the device and returns its current configuration settings. This endpoint verifies the device's authorization before allowing the connection.","parameters":[{"name":"deviceId","in":"path","description":"Device identifier.","required":true,"schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Connection established with device settings","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ConnectResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/ConnectResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/ConnectResponse"}}}},"400":{"description":"Device is disabled","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"401":{"description":"Not authorized or invalid credentials","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"Device not found","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"500":{"description":"Internal server error while connecting device"}}}}}}
```

## Reset a device connection and return a fresh API key and environment details.

> Generates a new API key for the device and returns connection details including the environment URI. This is useful when the device needs to reconnect or its credentials have been compromised.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Devices"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["ScopedAuthorizeRequirement"]},{"apiKey":["ScopedAuthorizeRequirement"]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"ConnectionToken":{"type":"object","properties":{"deviceId":{"type":["null","string"],"description":"Device identifier."},"tenantId":{"type":["null","string"],"description":"Tenant identifier."},"apiKey":{"type":["null","string"],"description":"Issued API key for the device."},"environment":{"type":["null","string"],"description":"Environment base URI the device should call.","format":"uri"}},"additionalProperties":false,"description":"Connection token information returned to the device."},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":["null","object"],"additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/devices/{deviceId}/connections/reset":{"post":{"tags":["Devices"],"summary":"Reset a device connection and return a fresh API key and environment details.","description":"Generates a new API key for the device and returns connection details including the environment URI. This is useful when the device needs to reconnect or its credentials have been compromised.","parameters":[{"name":"tenantId","in":"path","description":"Tenant identifier.","required":true,"schema":{"type":"string"}},{"name":"deviceId","in":"path","description":"Device identifier.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Connection token with new API key","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ConnectionToken"}},"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionToken"}},"text/json":{"schema":{"$ref":"#/components/schemas/ConnectionToken"}}}},"401":{"description":"Not authorized","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"500":{"description":"Internal server error while resetting device connection"}}}}}}
```
