swagger: '2.0' info: title: Koyeb Rest activity Sessions API description: 'The Koyeb API allows you to interact with the Koyeb platform in a simple, programmatic way using conventional HTTP requests. ' version: 1.0.0 host: app.koyeb.com schemes: - https security: - Bearer: [] tags: - name: Sessions paths: /v1/account/login: post: summary: Login user operationId: Login responses: '200': description: A successful response. schema: $ref: '#/definitions/LoginReply' '400': description: Validation error schema: $ref: '#/definitions/ErrorWithFields' '401': description: Returned when the token is not valid. schema: $ref: '#/definitions/Error' '403': description: Returned when the user does not have permission to access the resource. schema: $ref: '#/definitions/Error' '404': description: Returned when the resource does not exist. schema: $ref: '#/definitions/Error' '500': description: Returned in case of server error. schema: $ref: '#/definitions/Error' '503': description: Service is unavailable. schema: $ref: '#/definitions/Error' default: description: An unexpected error response. schema: $ref: '#/definitions/google.rpc.Status' parameters: - name: body in: body required: true schema: $ref: '#/definitions/LoginRequest' - name: seon-fp description: Seon Fingerprint in: header required: false type: string tags: - Sessions /v1/account/logout: delete: summary: Logout user operationId: Logout responses: '200': description: A successful response. schema: $ref: '#/definitions/LogoutReply' '400': description: Validation error schema: $ref: '#/definitions/ErrorWithFields' '401': description: Returned when the token is not valid. schema: $ref: '#/definitions/Error' '403': description: Returned when the user does not have permission to access the resource. schema: $ref: '#/definitions/Error' '404': description: Returned when the resource does not exist. schema: $ref: '#/definitions/Error' '500': description: Returned in case of server error. schema: $ref: '#/definitions/Error' '503': description: Service is unavailable. schema: $ref: '#/definitions/Error' default: description: An unexpected error response. schema: $ref: '#/definitions/google.rpc.Status' tags: - Sessions /v1/account/refresh: put: summary: Refresh token operationId: RefreshToken responses: '200': description: A successful response. schema: $ref: '#/definitions/LoginReply' '400': description: Validation error schema: $ref: '#/definitions/ErrorWithFields' '401': description: Returned when the token is not valid. schema: $ref: '#/definitions/Error' '403': description: Returned when the user does not have permission to access the resource. schema: $ref: '#/definitions/Error' '404': description: Returned when the resource does not exist. schema: $ref: '#/definitions/Error' '500': description: Returned in case of server error. schema: $ref: '#/definitions/Error' '503': description: Service is unavailable. schema: $ref: '#/definitions/Error' default: description: An unexpected error response. schema: $ref: '#/definitions/google.rpc.Status' tags: - Sessions /v1/account/session: post: summary: New session description: 'Creates a new session without an organization for current user. NOTE: If you want a session linked to another organization, please use "Switch organization".' operationId: NewSession responses: '200': description: A successful response. schema: $ref: '#/definitions/LoginReply' '400': description: Validation error schema: $ref: '#/definitions/ErrorWithFields' '401': description: Returned when the token is not valid. schema: $ref: '#/definitions/Error' '403': description: Returned when the user does not have permission to access the resource. schema: $ref: '#/definitions/Error' '404': description: Returned when the resource does not exist. schema: $ref: '#/definitions/Error' '500': description: Returned in case of server error. schema: $ref: '#/definitions/Error' '503': description: Service is unavailable. schema: $ref: '#/definitions/Error' default: description: An unexpected error response. schema: $ref: '#/definitions/google.rpc.Status' tags: - Sessions definitions: google.rpc.Status: type: object properties: code: type: integer format: int32 message: type: string details: type: array items: $ref: '#/definitions/google.protobuf.Any' Token: type: object example: id: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... expires: '2022-09-08T14:00:00Z' user_id: 996d7822-6b58-11e9-956f-32001b70f000 organization_id: 9f33b2c6-6b58-11e9-883c-32001b70f000 properties: id: type: string user_id: type: string organization_id: type: string expires_at: type: string format: date-time LoginRequest: type: object example: email: john@snow.com password: '...' properties: email: type: string title: User email password: type: string title: User password organization_id: type: string title: (Optional) Login into this organization ErrorWithFields: type: object properties: status: type: integer format: int32 code: type: string message: type: string fields: type: array items: $ref: '#/definitions/ErrorField' google.protobuf.Any: type: object properties: '@type': type: string additionalProperties: {} LogoutReply: type: object ErrorField: type: object properties: field: type: string description: type: string Error: type: object properties: status: type: integer format: int32 code: type: string message: type: string LoginReply: type: object properties: token: $ref: '#/definitions/Token' securityDefinitions: Bearer: type: apiKey name: Authorization in: header x-tagGroups: - name: Introduction tags: - intro - name: API tags: - Profile - Sessions - Users - organization - OrganizationMembers - OrganizationInvitations - OrganizationConfirmations - Subscriptions - Coupons - Credentials - Secrets - activity - Apps - Services - Deployments - Archives - RegionalDeployments - Instances - Domains - PersistentVolumes - Snapshots - Compose - Repositories - Logs - Metrics - Catalog - CatalogRegions - CatalogInstances - Usages - Summary - DockerHelper