Credentially Locations API
Facilities / sites where placements occur. Each belongs to one jurisdiction.
Facilities / sites where placements occur. Each belongs to one jurisdiction.
openapi: 3.1.0
info:
title: Credentially Public Compliance-packages Locations API
description: Public API Proxy with Rate Limiting and Audit
version: 2.0.0
servers:
- url: https://app.credentially.io/gateway
description: Generated server url
tags:
- name: Locations
description: Facilities / sites where placements occur. Each belongs to one jurisdiction.
paths:
/api/locations/{id}:
get:
tags:
- Locations
summary: Get a location by public id
description: '
**Rate Limit:** `update-location` (25 req / 1s)'
operationId: get_2
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
- name: X-API-Version
in: header
schema:
type: string
default: 2.0.0
enum:
- 2.0.0
responses:
'200':
description: Location found
content:
'*/*':
schema:
$ref: '#/components/schemas/LocationResponse'
'403':
description: Token lacks scope, or location not in caller's organisation
'429':
description: Too many requests - the rate limit for this endpoint has been exceeded. Use the Retry-After header to determine when to retry.
headers:
Retry-After:
description: Number of seconds to wait before retrying the request.
schema:
type: integer
format: int32
example: 1
security:
- bearer-key: []
put:
tags:
- Locations
summary: Update a location
description: '
**Rate Limit:** `update-location` (25 req / 1s)'
operationId: update_3
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
- name: X-API-Version
in: header
schema:
type: string
default: 2.0.0
enum:
- 2.0.0
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/LocationRequest'
required: true
responses:
'200':
description: Location updated
content:
'*/*':
schema:
$ref: '#/components/schemas/LocationResponse'
'400':
description: Validation failed, or referenced jurisdiction/type not in this organisation
'403':
description: Token lacks scope, or location not in caller's organisation
'409':
description: A location with the new name already exists
'429':
description: Too many requests - the rate limit for this endpoint has been exceeded. Use the Retry-After header to determine when to retry.
headers:
Retry-After:
description: Number of seconds to wait before retrying the request.
schema:
type: integer
format: int32
example: 1
security:
- bearer-key: []
delete:
tags:
- Locations
summary: Delete a location
description: '
**Rate Limit:** `update-location` (25 req / 1s)'
operationId: delete_2
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
- name: X-API-Version
in: header
schema:
type: string
default: 2.0.0
enum:
- 2.0.0
responses:
'204':
description: Location deleted
'403':
description: Token lacks scope, or location not in caller's organisation
'429':
description: Too many requests - the rate limit for this endpoint has been exceeded. Use the Retry-After header to determine when to retry.
headers:
Retry-After:
description: Number of seconds to wait before retrying the request.
schema:
type: integer
format: int32
example: 1
security:
- bearer-key: []
/api/locations:
get:
tags:
- Locations
summary: List locations
description: '
**Rate Limit:** `create-location` (25 req / 1s)'
operationId: list_2
parameters:
- name: X-API-Version
in: header
schema:
type: string
default: 2.0.0
enum:
- 2.0.0
responses:
'200':
description: Locations retrieved
content:
'*/*':
schema:
type: array
items:
$ref: '#/components/schemas/LocationResponse'
'401':
description: Missing or invalid bearer token
'403':
description: Token lacks required scope
'429':
description: Too many requests - the rate limit for this endpoint has been exceeded. Use the Retry-After header to determine when to retry.
headers:
Retry-After:
description: Number of seconds to wait before retrying the request.
schema:
type: integer
format: int32
example: 1
security:
- bearer-key: []
post:
tags:
- Locations
summary: Create a location
description: '
**Rate Limit:** `create-location` (25 req / 1s)'
operationId: create_2
parameters:
- name: X-API-Version
in: header
schema:
type: string
default: 2.0.0
enum:
- 2.0.0
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/LocationRequest'
required: true
responses:
'201':
description: Location created
content:
'*/*':
schema:
$ref: '#/components/schemas/LocationResponse'
'400':
description: Validation failed, or referenced jurisdiction/type not in this organisation
'409':
description: A location with that name already exists
'429':
description: Too many requests - the rate limit for this endpoint has been exceeded. Use the Retry-After header to determine when to retry.
headers:
Retry-After:
description: Number of seconds to wait before retrying the request.
schema:
type: integer
format: int32
example: 1
security:
- bearer-key: []
components:
schemas:
LocationResponse:
type: object
properties:
publicId:
type: string
format: uuid
name:
type: string
locationTypePublicId:
type: string
format: uuid
locationTypeName:
type: string
jurisdictionPublicId:
type: string
format: uuid
jurisdictionName:
type: string
address1:
type: string
address2:
type: string
city:
type: string
countyState:
type: string
country:
type: string
postcodeZip:
type: string
createdAt:
type: string
format: date-time
createdBy:
type: string
format: uuid
updatedAt:
type: string
format: date-time
updatedBy:
type: string
format: uuid
LocationRequest:
type: object
properties:
name:
type: string
maxLength: 256
minLength: 0
locationTypePublicId:
type: string
format: uuid
jurisdictionPublicId:
type: string
format: uuid
address1:
type: string
maxLength: 128
minLength: 0
address2:
type: string
maxLength: 128
minLength: 0
city:
type: string
maxLength: 128
minLength: 0
countyState:
type: string
maxLength: 128
minLength: 0
country:
type: string
maxLength: 128
minLength: 0
postcodeZip:
type: string
maxLength: 50
minLength: 0
required:
- jurisdictionPublicId
- locationTypePublicId
- name
securitySchemes:
bearer-key:
type: http
scheme: bearer
bearerFormat: JWT