openapi: 3.1.0 info: version: 1.0.0 title: Hatchet API Token User API description: The Hatchet API servers: - url: '' security: - bearerAuth: [] - cookieAuth: [] tags: - name: User paths: /api/v1/users/login: post: description: Logs in a user. operationId: user:update:login requestBody: content: application/json: schema: $ref: '#/components/schemas/UserLoginRequest' responses: '200': content: application/json: schema: $ref: '#/components/schemas/User' description: Successfully logged in '400': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: A malformed or bad request '401': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Unauthorized '405': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Method not allowed '422': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Unprocessable Entity - validation or processing errors security: [] x-enable-rate-limiting: true summary: Login User tags: - User /api/v1/users/google/start: get: description: Starts the OAuth flow operationId: user:update:google-oauth-start responses: '302': description: Successfully started the OAuth flow headers: location: schema: type: string security: [] summary: Start Oauth Flow tags: - User /api/v1/users/google/callback: get: description: Completes the OAuth flow operationId: user:update:google-oauth-callback responses: '302': description: Successfully completed the OAuth flow headers: location: schema: type: string security: [] summary: Complete Oauth Flow tags: - User /api/v1/users/github/start: get: description: Starts the OAuth flow operationId: user:update:github-oauth-start responses: '302': description: Successfully started the OAuth flow headers: location: schema: type: string security: [] summary: Start Oauth Flow tags: - User /api/v1/users/github/callback: get: description: Completes the OAuth flow operationId: user:update:github-oauth-callback responses: '302': description: Successfully completed the OAuth flow headers: location: schema: type: string security: [] summary: Complete Oauth Flow tags: - User /api/v1/tenants/{tenant}/slack/start: get: x-resources: - tenant description: Starts the OAuth flow operationId: user:update:slack-oauth-start parameters: - description: The tenant id in: path name: tenant required: true schema: type: string format: uuid minLength: 36 maxLength: 36 responses: '302': description: Successfully started the OAuth flow headers: location: schema: type: string security: - cookieAuth: [] summary: Start Oauth Flow tags: - User /api/v1/users/slack/callback: get: description: Completes the OAuth flow operationId: user:update:slack-oauth-callback responses: '302': description: Successfully completed the OAuth flow headers: location: schema: type: string security: - cookieAuth: [] summary: Complete Oauth Flow tags: - User /api/v1/users/current: get: description: Gets the current user operationId: user:get:current responses: '200': content: application/json: schema: $ref: '#/components/schemas/User' description: Successfully retrieved the user '400': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: A malformed or bad request '401': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Unauthorized '405': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Method not allowed security: - cookieAuth: [] summary: Get Current User tags: - User /api/v1/users/password: post: description: Update a user password. operationId: user:update:password requestBody: content: application/json: schema: $ref: '#/components/schemas/UserChangePasswordRequest' responses: '200': content: application/json: schema: $ref: '#/components/schemas/User' description: Successfully changed password '400': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: A malformed or bad request '401': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Unauthorized '405': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Method not allowed '422': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Unprocessable Entity - validation or processing errors security: - cookieAuth: [] x-enable-rate-limiting: true summary: Change User Password tags: - User /api/v1/users/register: post: description: Registers a user. operationId: user:create requestBody: content: application/json: schema: $ref: '#/components/schemas/UserRegisterRequest' responses: '200': content: application/json: schema: $ref: '#/components/schemas/User' description: Successfully registered the user '400': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: A malformed or bad request '401': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Unauthorized '405': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Method not allowed '422': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Unprocessable Entity - validation or processing errors security: [] x-enable-rate-limiting: true summary: Register User tags: - User /api/v1/users/logout: post: description: Logs out a user. operationId: user:update:logout responses: '200': content: application/json: schema: $ref: '#/components/schemas/User' description: Successfully logged out '400': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: A malformed or bad request '401': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Unauthorized '405': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Method not allowed security: - cookieAuth: [] summary: Logout User tags: - User /api/v1/users/memberships: get: description: Lists all tenant memberships for the current user operationId: tenant-memberships:list responses: '200': content: application/json: schema: $ref: '#/components/schemas/UserTenantMembershipsList' description: Successfully listed the tenant memberships '400': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: A malformed or bad request '403': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Forbidden security: - cookieAuth: [] summary: List Tenant Memberships tags: - User components: schemas: PaginationResponse: type: object properties: current_page: type: integer description: the current page format: int64 example: 2 next_page: type: integer description: the next page format: int64 example: 3 num_pages: type: integer description: the total number of pages for listing format: int64 example: 10 example: next_page: 3 num_pages: 10 current_page: 2 TenantVersion: enum: - V0 - V1 type: string UserTenantMembershipsList: properties: pagination: $ref: '#/components/schemas/PaginationResponse' rows: items: $ref: '#/components/schemas/TenantMember' type: array x-go-name: Rows UserChangePasswordRequest: properties: password: type: string description: The password of the user. x-oapi-codegen-extra-tags: validate: required,password newPassword: type: string description: The new password for the user. x-oapi-codegen-extra-tags: validate: required,password required: - password - newPassword type: object TenantMember: properties: metadata: $ref: '#/components/schemas/APIResourceMeta' user: $ref: '#/components/schemas/UserTenantPublic' description: The user associated with this tenant member. role: $ref: '#/components/schemas/TenantMemberRole' description: The role of the user in the tenant. tenant: $ref: '#/components/schemas/Tenant' description: The tenant associated with this tenant member. required: - metadata - user - role type: object TenantEnvironment: enum: - local - development - production type: string TenantMemberRole: enum: - OWNER - ADMIN - MEMBER type: string Tenant: properties: metadata: $ref: '#/components/schemas/APIResourceMeta' name: type: string description: The name of the tenant. slug: type: string description: The slug of the tenant. analyticsOptOut: type: boolean description: Whether the tenant has opted out of analytics. alertMemberEmails: type: boolean description: Whether to alert tenant members. version: $ref: '#/components/schemas/TenantVersion' description: The version of the tenant. environment: $ref: '#/components/schemas/TenantEnvironment' description: The environment type of the tenant. serverUrl: type: string description: The server URL for the tenant (includes scheme) region: type: string description: Control-plane shard region for the tenant (e.g. aws:us-west-2). required: - metadata - name - slug - version type: object APIResourceMeta: type: object properties: id: type: string description: the id of this resource, in UUID format example: bb214807-246e-43a5-a25d-41761d1cff9e minLength: 0 maxLength: 36 createdAt: type: string description: the time that this resource was created format: date-time example: '2022-12-13T15:06:48.888358-05:00' updatedAt: type: string description: the time that this resource was last updated format: date-time example: '2022-12-13T15:06:48.888358-05:00' required: - id - createdAt - updatedAt UserRegisterRequest: properties: name: type: string description: The name of the user. email: type: string format: email description: The email address of the user. x-oapi-codegen-extra-tags: validate: required,email password: type: string description: The password of the user. x-oapi-codegen-extra-tags: validate: required,password required: - name - email - password type: object User: properties: metadata: $ref: '#/components/schemas/APIResourceMeta' name: type: string description: The display name of the user. email: type: string format: email description: The email address of the user. emailVerified: type: boolean description: Whether the user has verified their email address. hasPassword: type: boolean description: Whether the user has a password set. emailHash: type: string description: A hash of the user's email address for use with Pylon Support Chat required: - metadata - email - emailVerified type: object UserLoginRequest: properties: email: type: string format: email description: The email address of the user. x-oapi-codegen-extra-tags: validate: required,email password: type: string description: The password of the user. x-oapi-codegen-extra-tags: validate: required,password required: - email - password type: object APIErrors: type: object properties: errors: type: array items: $ref: '#/components/schemas/APIError' required: - errors UserTenantPublic: properties: email: type: string format: email description: The email address of the user. name: type: string description: The display name of the user. required: - email type: object APIError: type: object properties: code: type: integer description: a custom Hatchet error code format: uint64 example: 1400 field: type: string description: the field that this error is associated with, if applicable example: name description: type: string description: a description for this error example: A descriptive error message docs_link: type: string description: a link to the documentation for this error, if it exists example: github.com/hatchet-dev/hatchet required: - description securitySchemes: bearerAuth: type: http scheme: bearer cookieAuth: type: apiKey in: cookie name: hatchet customAuth: type: http scheme: bearer