-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.json
1 lines (1 loc) · 39 KB
/
openapi.json
1
{"openapi":"3.0.0","info":{"title":"Source Cooperative API","version":"1.0.0"},"servers":[{"url":"https://source.coop/api/v1","description":"Source Cooperative"}],"paths":{"/accounts/{account_id}/api-keys":{"post":{"tags":["API Keys","Accounts"],"summary":"Create a new API key for an account.","description":"Creates a new API key for the specified account. API key expiration date must be in the future. For user accounts, you must be authenticated as the user account you are creating the API key for. For organization accounts, you must be authenticated as either an `owners` or `maintainers` member for the organization account you are creating the API key for.\nOnly users with the `admin` flag may create API keys for service accounts.\n","parameters":[{"in":"path","name":"account_id","required":true,"schema":{"type":"string"},"description":"The ID of the account to create the API key for"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyRequest"}}}},"responses":{"200":{"description":"Successfully created API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKey"}}}},"400":{"description":"Bad request - Invalid request body or expiration date"},"401":{"description":"Unauthorized - No valid session found or insufficient permissions"},"404":{"description":"Not Found - Account not found"},"500":{"description":"Internal server error"}}},"get":{"tags":["API Keys","Accounts"],"summary":"List API keys for an account","description":"Retrieves all API keys associated with the specified account. For user accounts, you must be authenticated as the user account you are listing API keys for. For organization accounts, you must be authenticated as either an `owners` or `maintainers` member of the organization account you are listing API keys for.\nOnly users with the `admin` flag may list API keys for service accounts.","parameters":[{"in":"path","name":"account_id","required":true,"schema":{"type":"string"},"description":"The ID of the account to list API keys for"}],"responses":{"200":{"description":"Successfully retrieved API keys","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RedactedAPIKey"}}}}},"401":{"description":"Unauthorized - No valid session found or insufficient permissions"},"404":{"description":"Not Found - Account not found"},"500":{"description":"Internal server error"}}}},"/accounts/{account_id}/flags":{"get":{"tags":["Accounts"],"summary":"Get account flags","description":"Retrieves the flags of a specific account. For a User account, users may only get the flags for their own account. For an Organization account, only users who are `owners` or `maintainers` of the organization may get the flags. Users with the `admin` flag may get the flags for any account.","parameters":[{"in":"path","name":"account_id","required":true,"schema":{"type":"string"},"description":"The ID of the account whose flags to retrieve"}],"responses":{"200":{"description":"Successfully retrieved account flags","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountFlags"}}}},"401":{"description":"Unauthorized - No valid session found or insufficient permissions"},"404":{"description":"Not Found - Account with the specified ID does not exist"},"500":{"description":"Internal server error"}}},"put":{"tags":["Accounts"],"summary":"Update account flags","description":"Updates the flags of a specific account. You must have the `admin` flag to update the flags for an account.","parameters":[{"in":"path","name":"account_id","required":true,"schema":{"type":"string"},"description":"The ID of the account whose flags to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountFlags"}}}},"responses":{"200":{"description":"Successfully updated the account flags","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountFlags"}}}},"400":{"description":"Bad Request - Invalid flags data"},"401":{"description":"Unauthorized - No valid session found or insufficient permissions"},"404":{"description":"Not Found - Account with the specified ID does not exist"},"500":{"description":"Internal server error"}}}},"/accounts/{account_id}":{"get":{"tags":["Accounts"],"summary":"Get account details","description":"Retrieves the details of a specific account. For a User account, you must be authenticated as the user you are retrieving the account details for. For an Organization account, you must be authenticated as either an `owners` or `maintainers` member of the organization you are retrieving the account details for. Users with the `admin` flag may retrieve the account details for any account.","parameters":[{"in":"path","name":"account_id","required":true,"schema":{"type":"string"},"description":"The ID of the account to retrieve"}],"responses":{"200":{"description":"Successfully retrieved account details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"401":{"description":"Unauthorized - No valid session found or insufficient permissions"},"404":{"description":"Not Found - Account with the specified ID does not exist"},"500":{"description":"Internal server error"}}},"delete":{"tags":["Accounts"],"summary":"Disable an account","description":"Disables a specific account. User accounts may not be disabled unless you are authenticated as a user with the `admin` flag. Organization accounts require that you are authenticated as an `owners` or `maintainers` member of the organization.","parameters":[{"in":"path","name":"account_id","required":true,"schema":{"type":"string"},"description":"The ID of the account to disable"}],"responses":{"200":{"description":"Successfully disabled the account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"401":{"description":"Unauthorized - No valid session found or insufficient permissions"},"404":{"description":"Not Found - Account with the specified ID does not exist"},"500":{"description":"Internal server error"}}}},"/accounts/{account_id}/members":{"post":{"tags":["Memberships","Accounts"],"summary":"Invite a new member to an account.","description":"Invites a new member to the specified account. For user accounts, you must be authenticated as the user account you are inviting the member to. For organization accounts, you must be authenticated as either an `owners` or `maintainers` member for the organization account you are inviting the member to.\nOnly users with the `admin` flag may invite members to service accounts.\n","parameters":[{"in":"path","name":"account_id","required":true,"schema":{"type":"string"},"description":"The ID of the account to invite the member to"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipInvitation"}}}},"responses":{"200":{"description":"Successfully invited member","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Membership"}}}},"400":{"description":"Bad request - Invalid request body or member already invited/exists"},"401":{"description":"Unauthorized - No valid session found or insufficient permissions"},"404":{"description":"Not Found - Account not found"},"500":{"description":"Internal server error"}}},"get":{"tags":["Memberships","Accounts"],"summary":"List the memberships for an account","description":"Retrieves all memberships associated with the specified account.\nFor user accounts, you must be authenticated as the user account you are listing memberships for.\nFor organization accounts, you must be authenticated as either an `owners` or `maintainers` member of the organization account you are listing memberships for.\n\nOnly users with the `admin` flag may list memberships for service accounts.\n","parameters":[{"in":"path","name":"account_id","required":true,"schema":{"type":"string"},"description":"The ID of the account to list memberships for"}],"responses":{"200":{"description":"Successfully retrieved memberships","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Membership"}}}}},"401":{"description":"Unauthorized - No valid session found or insufficient permissions"},"404":{"description":"Not Found - Account not found"},"500":{"description":"Internal server error"}}}},"/accounts/{account_id}/profile":{"get":{"tags":["Accounts"],"summary":"Get account profile","description":"Retrieves the profile of a specific account. Any user, authenticated or not, can retrieve the profile of any account.","parameters":[{"in":"path","name":"account_id","required":true,"schema":{"type":"string"},"description":"The ID of the account whose profile to retrieve"}],"responses":{"200":{"description":"Successfully retrieved account profile","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountProfile"}}}},"401":{"description":"Unauthorized - No valid session found or insufficient permissions"},"404":{"description":"Not Found - Account with the specified ID does not exist"},"500":{"description":"Internal server error"}}},"put":{"tags":["Accounts"],"summary":"Update account profile","description":"Updates the profile of a specific account. For a User account, you must be authenticated as the user you are updating the profile for. For an Organization account, you must be authenticated as an `owners` member of the organization you are updating the profile for. Users with the `admin` flag may update the profile for any account.","parameters":[{"in":"path","name":"account_id","required":true,"schema":{"type":"string"},"description":"The ID of the account whose profile to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountProfile"}}}},"responses":{"200":{"description":"Successfully updated the account profile","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountProfile"}}}},"400":{"description":"Bad Request - Invalid profile data"},"401":{"description":"Unauthorized - No valid session found or insufficient permissions"},"404":{"description":"Not Found - Account with the specified ID does not exist"},"500":{"description":"Internal server error"}}}},"/accounts":{"post":{"tags":["Accounts"],"summary":"Create a new account","description":"Creates a new account. Authenticated users can only create a user account if they do not already have one. Only users with the `create_organizations` flag may create organization accounts. Users with the `admin` flag may create any account.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountCreationRequest"}}}},"responses":{"200":{"description":"Successfully created account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"400":{"description":"Bad request - Invalid request body or an account with the same ID already exists"},"401":{"description":"Unauthorized - No valid session found or user already has an account"},"500":{"description":"Internal server error"}}}},"/api-keys/{access_key_id}":{"delete":{"tags":["API Keys"],"summary":"Revoke an API key","description":"Revokes (disables) the specified API key. For an API Key assigned to a User account, only the user who created the API key can revoke it. For an API Key assigned to an Organization, only organization members with `owners` or `maintainers` membership can revoke it. For an API Key assigned to a Repoisitory, only repository or organization members with `owners` or `maintainers` membership can revoke it. Users with the `admin` flag may disable any API Key.","parameters":[{"in":"path","name":"access_key_id","required":true,"schema":{"type":"string"},"description":"The access key ID of the API key to revoke"}],"responses":{"200":{"description":"Successfully revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedactedAPIKey"}}}},"401":{"description":"Unauthorized - No valid session found, insufficient permissions, or API key not found"},"500":{"description":"Internal server error"}}}},"/data-connections/{data_connection_id}":{"get":{"tags":["Data Connections"],"summary":"Get a data connection","description":"Retrieves a data connection by its ID. Authentication credentials are only included for users with the appropriate permissions.","parameters":[{"in":"path","name":"data_connection_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved the data connection","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataConnection"}}}},"401":{"description":"Unauthorized - No valid session found or insufficient permissions"},"404":{"description":"Not Found - Data connection with the given ID does not exist"},"500":{"description":"Internal server error"}}},"put":{"tags":["Data Connections"],"summary":"Update a data connection","description":"Updates an existing data connection. Only users with the appropriate permissions can update data connections.","parameters":[{"in":"path","name":"data_connection_id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataConnection"}}}},"responses":{"200":{"description":"Successfully updated the data connection","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataConnection"}}}},"400":{"description":"Bad Request - Invalid data connection data"},"401":{"description":"Unauthorized - No valid session found or insufficient permissions"},"404":{"description":"Not Found - Data connection with the given ID does not exist"},"500":{"description":"Internal server error"}}},"delete":{"tags":["Data Connections"],"summary":"Disable a data connection","description":"Disables a data connection by setting it to read-only. Only users with the appropriate permissions can disable data connections.","parameters":[{"in":"path","name":"data_connection_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully disabled the data connection","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataConnection"}}}},"401":{"description":"Unauthorized - No valid session found or insufficient permissions"},"404":{"description":"Not Found - Data connection with the given ID does not exist"},"500":{"description":"Internal server error"}}}},"/data-connections/available":{"get":{"tags":["Data Connections"],"summary":"List data connections available to the user for repository creation","description":"Retrieves a list of data connections which the user is allowed to use for creating repositories. The list is sanitized of data connection credentials based on the user's permissions.","responses":{"200":{"description":"Successfully retrieved the list of data connections","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DataConnection"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/data-connections":{"get":{"tags":["Data Connections"],"summary":"List data connections","description":"Retrieves a list of data connections. The list is sanitized of data connection credentials based on the user's permissions.","responses":{"200":{"description":"Successfully retrieved the list of data connections","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DataConnection"}}}}},"500":{"description":"Internal server error"}}},"post":{"tags":["Data Connections"],"summary":"Create a new data connection","description":"Creates a new data connection. Only users with the `admin` flag may create data connections.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataConnection"}}}},"responses":{"200":{"description":"Successfully created the data connection","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataConnection"}}}},"400":{"description":"Bad Request - Invalid data connection data or data connection already exists"},"401":{"description":"Unauthorized - No valid session found or insufficient permissions"},"500":{"description":"Internal server error"}}}},"/memberships/{membership_id}/accept":{"post":{"tags":["Memberships"],"summary":"Accept a membership invitation.","description":"Accepts a membership invitation for the specified membership. The user must be authorized to accept the membership.\n","parameters":[{"in":"path","name":"membership_id","required":true,"schema":{"type":"string"},"description":"The ID of the membership to accept"}],"responses":{"200":{"description":"Successfully accepted membership","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Membership"}}}},"400":{"description":"Bad Request - Membership is not in a pending state"},"401":{"description":"Unauthorized - No valid session found or insufficient permissions"},"404":{"description":"Not Found - Membership not found"},"500":{"description":"Internal server error"}}}},"/memberships/{membership_id}/reject":{"post":{"tags":["Memberships"],"summary":"Rejects a membership invitation.","description":"Rejects a membership invitation for the specified membership. The user must be authorized to reject the membership.\n","parameters":[{"in":"path","name":"membership_id","required":true,"schema":{"type":"string"},"description":"The ID of the membership to reject"}],"responses":{"200":{"description":"Successfully rejected membership","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Membership"}}}},"400":{"description":"Bad Request - Membership is not in a pending state"},"401":{"description":"Unauthorized - No valid session found or insufficient permissions"},"404":{"description":"Not Found - Membership not found"},"500":{"description":"Internal server error"}}}},"/memberships/{membership_id}/revoke":{"post":{"tags":["Memberships"],"summary":"Revokes a membership.","description":"Revokes the specified membership. The user must be authorized to revoke the membership.\n","parameters":[{"in":"path","name":"membership_id","required":true,"schema":{"type":"string"},"description":"The ID of the membership to revoke"}],"responses":{"200":{"description":"Successfully revoked membership","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Membership"}}}},"400":{"description":"Bad Request - Membership is already revoked"},"401":{"description":"Unauthorized - No valid session found or insufficient permissions"},"404":{"description":"Not Found - Membership not found"},"500":{"description":"Internal server error"}}}},"/memberships/{membership_id}/update-role":{"post":{"tags":["Memberships"],"summary":"Updates a membership role.","description":"Updates the specified membership. The user must be authorized to update the membership.\n","parameters":[{"in":"path","name":"membership_id","required":true,"schema":{"type":"string"},"description":"The ID of the membership to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipRole"}}}},"responses":{"200":{"description":"Successfully updated membership","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Membership"}}}},"401":{"description":"Unauthorized - No valid session found or insufficient permissions"},"404":{"description":"Not Found - Membership not found"},"500":{"description":"Internal server error"}}}},"/repositories/{account_id}/{repository_id}/api-keys":{"post":{"tags":["API Keys","Repositories"],"summary":"Create a new API key","description":"Creates a new API key for the specified repository. Only users who are an `owners` or `maintainers` member of the repository or organization may create an API Key. Users with the `admin` flag may create API keys for any repository.","parameters":[{"in":"path","name":"account_id","required":true,"schema":{"type":"string"},"description":"The ID of the account"},{"in":"path","name":"repository_id","required":true,"schema":{"type":"string"},"description":"The ID of the repository to create the API key for"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyRequest"}}}},"responses":{"200":{"description":"Successfully created API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKey"}}}},"400":{"description":"Bad request - Invalid request body or expiration date"},"401":{"description":"Unauthorized - No valid session found or insufficient permissions"},"404":{"description":"Not Found - Repository not found"},"500":{"description":"Internal server error"}}},"get":{"tags":["API Keys","Repositories"],"summary":"List API keys for a repository","description":"Retrieves all API keys associated with the specified repository. Only users who are an `owners` or `maintainers` member of the repository or organization may list API keys. Users with the `admin` flag may list API keys for any repository.","parameters":[{"in":"path","name":"account_id","required":true,"schema":{"type":"string"},"description":"The ID of the account"},{"in":"path","name":"repository_id","required":true,"schema":{"type":"string"},"description":"The ID of the repository to list API keys for"}],"responses":{"200":{"description":"Successfully retrieved API keys","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RedactedAPIKey"}}}}},"401":{"description":"Unauthorized - No valid session found or insufficient permissions"},"404":{"description":"Not Found - Repository not found"},"500":{"description":"Internal server error"}}}},"/repositories/{account_id}/{repository_id}":{"put":{"tags":["Repositories"],"summary":"Update an existing repository","parameters":[{"in":"path","name":"account_id","required":true,"schema":{"type":"string"},"description":"The ID of the account that owns the repository"},{"in":"path","name":"repository_id","required":true,"schema":{"type":"string"},"description":"The ID of the repository to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepositoryUpdateRequest"}}}},"responses":{"200":{"description":"Successfully updated repository","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Repository"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}},"description":"Updates an existing repository for the specified account.\nFor user accounts, you must be authenticated as the user account you are updating the repository for.\nFor organization accounts, you must be authenticated as either an `owners` or `maintainers` member for the organization you are updating the repository for.\n\nUsers with the `admin` flag may update repositories for any account.\n"},"delete":{"tags":["Repositories"],"summary":"Disable an existing repository","description":"Disables an existing repository for the specified account.\nFor user accounts, you must be authenticated as the user account you are disabling the repository for.\nFor organization accounts, you must be authenticated as either an `owners` or `maintainers` member for the organization you are disabling the repository for.\n\nUsers with the `admin` flag may disable repositories for any account.\n","parameters":[{"in":"path","name":"account_id","required":true,"schema":{"type":"string"},"description":"The ID of the account that owns the repository"},{"in":"path","name":"repository_id","required":true,"schema":{"type":"string"},"description":"The ID of the repository to disable"}],"responses":{"200":{"description":"Successfully disabled repository","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Repository"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"get":{"tags":["Repositories"],"summary":"Get an existing repository","description":"Retrieves an existing repository for the specified account.\nFor user accounts, you must be authenticated as the user account you are retrieving the repository for.\nFor organization accounts, you must be authenticated as either an `owners` or `maintainers` member for the organization you are retrieving the repository from.\n\nUsers with the `admin` flag may retrieve repositories for any account.\n","parameters":[{"in":"path","name":"account_id","required":true,"schema":{"type":"string"},"description":"The ID of the account that owns the repository"},{"in":"path","name":"repository_id","required":true,"schema":{"type":"string"},"description":"The ID of the repository to retrieve"}],"responses":{"200":{"description":"Successfully retrieved repository","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Repository"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/repositories/{account_id}/{repository_id}/members":{"post":{"tags":["Memberships","Repositories"],"summary":"Invite a new member to a repository.","description":"Invites a new member to the specified repository. For user accounts, you must be authenticated as the user account you are inviting the member to. For organization accounts, you must be authenticated as either an `owners` or `maintainers` member of the organization or repository you are inviting the member to.\nUsers with the `admin` flag may invite users to any repository.\n","parameters":[{"in":"path","name":"account_id","required":true,"schema":{"type":"string"},"description":"The ID of the account that owns the repository"},{"in":"path","name":"repository_id","required":true,"schema":{"type":"string"},"description":"The ID of the repository to invite the member to"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipInvitation"}}}},"responses":{"200":{"description":"Successfully invited member","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Membership"}}}},"400":{"description":"Bad request - Invalid request body or member already invited/exists"},"401":{"description":"Unauthorized - No valid session found or insufficient permissions"},"404":{"description":"Not Found - Repository not found"},"500":{"description":"Internal server error"}}},"get":{"tags":["Memberships","Repositories"],"summary":"List the memberships for a repository","description":"Retrieves all memberships associated with the specified repository.\nFor user accounts, you must be authenticated as the user account you are listing memberships for.\nFor organization accounts, you must be authenticated as either an `owners` or `maintainers` member for the organization or repository you are listing memberships for.\n\nUsers with the `admin` flag may list memberships for any repository.\n","parameters":[{"in":"path","name":"account_id","required":true,"schema":{"type":"string"},"description":"The ID of the account that owns the repository"},{"in":"path","name":"repository_id","required":true,"schema":{"type":"string"},"description":"The ID of the repository to list memberships for"}],"responses":{"200":{"description":"Successfully retrieved memberships","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Membership"}}}}},"401":{"description":"Unauthorized - No valid session found or insufficient permissions"},"404":{"description":"Not Found - Repository not found"},"500":{"description":"Internal server error"}}}},"/repositories/{account_id}":{"post":{"tags":["Repositories"],"summary":"Create a new repository","description":"Creates a new repository for the specified account.\nFor user accounts, you must be authenticated as the user account you are creating the repository for.\nFor organization accounts, you must be authenticated as either an `owners` or `maintainers` member for the organization you are creating the repository for.\n\nUsers with the `admin` flag may create repositories for any account.\n","parameters":[{"in":"path","name":"account_id","required":true,"schema":{"type":"string"},"description":"The ID of the account to create the repository for"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepositoryCreationRequest"}}}},"responses":{"200":{"description":"Successfully created repository","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Repository"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/whoami":{"get":{"tags":["Authentication"],"description":"Get the current user's session information. If the user is authenticated but has not created an account, the account field will be null. If the user is not authenticated, a `401 - Unauthorized` response will be returned. This endpoint can be used to list all of the authenticated user's memberships.","responses":{"200":{"description":"Returns the user session data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSession"}}}},"401":{"description":"Unauthorized - No valid session found"}}}}},"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Follows the format `<access-key-id> <secret-access-key>`"}},"schemas":{"AccountType":{"type":"string","enum":["user","organization","service"]},"AccountProfile":{"type":"object","properties":{"name":{"type":"string","nullable":true,"maxLength":128,"example":"Isaac Asimov"},"bio":{"type":"string","nullable":true,"maxLength":1024,"example":"Software Engineer @radiantearth"},"location":{"type":"string","nullable":true,"maxLength":128,"example":"Augsburg, Germany"},"url":{"type":"string","nullable":true,"format":"uri","example":"https://source.coop"}}},"AccountFlags":{"type":"array","items":{"type":"string","enum":["admin","create_repositories","create_organizations"]}},"Account":{"type":"object","properties":{"account_id":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[a-z0-9](?:(?!--)[a-z0-9-])*[a-z0-9]$","example":"account-id"},"account_type":{"$ref":"#/components/schemas/AccountType"},"identity_id":{"type":"string","example":"identity-id"},"disabled":{"type":"boolean"},"profile":{"$ref":"#/components/schemas/AccountProfile"},"flags":{"$ref":"#/components/schemas/AccountFlags"}},"required":["account_id","account_type","disabled","profile","flags"]},"MembershipRole":{"type":"string","enum":["owners","maintainers","read_data","write_data"]},"MembershipState":{"type":"string","enum":["invited","revoked","member"]},"Membership":{"type":"object","properties":{"membership_id":{"type":"string","format":"uuid","example":"00000000-0000-0000-0000-000000000000"},"account_id":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[a-z0-9](?:(?!--)[a-z0-9-])*[a-z0-9]$","example":"account-id"},"membership_account_id":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[a-z0-9](?:(?!--)[a-z0-9-])*[a-z0-9]$","example":"organization-id"},"repository_id":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[a-z0-9](?:(?!--)[a-z0-9-])*[a-z0-9]$","example":"repository-id"},"role":{"$ref":"#/components/schemas/MembershipRole"},"state":{"$ref":"#/components/schemas/MembershipState"},"state_changed":{"type":"string","format":"date-time"}},"required":["membership_id","account_id","membership_account_id","role","state","state_changed"]},"UserSession":{"type":"object","properties":{"identity_id":{"type":"string","example":"identity-id"},"account":{"$ref":"#/components/schemas/Account"},"memberships":{"type":"array","items":{"$ref":"#/components/schemas/Membership"}}}},"AccountCreationRequest":{"type":"object","properties":{"account_id":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[a-z0-9](?:(?!--)[a-z0-9-])*[a-z0-9]$","example":"account-id"},"account_type":{"$ref":"#/components/schemas/AccountType"},"profile":{"$ref":"#/components/schemas/AccountProfile"}},"required":["account_id","account_type","profile"]},"APIKey":{"type":"object","properties":{"access_key_id":{"type":"string","minLength":2,"maxLength":24,"example":"SCFOOBAR"},"account_id":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[a-z0-9](?:(?!--)[a-z0-9-])*[a-z0-9]$","example":"account-id"},"repository_id":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[a-z0-9](?:(?!--)[a-z0-9-])*[a-z0-9]$","example":"repository-id"},"disabled":{"type":"boolean"},"expires":{"type":"string","format":"date-time"},"name":{"type":"string","minLength":1,"maxLength":128,"example":"Dev Machine"},"secret_access_key":{"type":"string","minLength":64,"maxLength":64}},"required":["access_key_id","account_id","disabled","expires","name","secret_access_key"]},"APIKeyRequest":{"type":"object","properties":{"name":{"type":"string","example":"Dev Machine"},"expires":{"type":"string","format":"date-time"}},"required":["name","expires"]},"RedactedAPIKey":{"type":"object","properties":{"access_key_id":{"type":"string","minLength":2,"maxLength":24,"example":"SCFOOBAR"},"account_id":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[a-z0-9](?:(?!--)[a-z0-9-])*[a-z0-9]$","example":"account-id"},"repository_id":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[a-z0-9](?:(?!--)[a-z0-9-])*[a-z0-9]$","example":"repository-id"},"disabled":{"type":"boolean"},"expires":{"type":"string","format":"date-time"},"name":{"type":"string","minLength":1,"maxLength":128,"example":"Dev Machine"}},"required":["access_key_id","account_id","disabled","expires","name"]},"MembershipInvitation":{"type":"object","properties":{"account_id":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[a-z0-9](?:(?!--)[a-z0-9-])*[a-z0-9]$","example":"account-id"},"role":{"$ref":"#/components/schemas/MembershipRole"}},"required":["account_id","role"]},"S3DataConnection":{"type":"object","properties":{"provider":{"type":"string","enum":["s3"]},"bucket":{"type":"string"},"base_prefix":{"type":"string"},"region":{"type":"string","enum":["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-northeast-3","ap-south-1","ap-south-2","ap-southeast-1","ap-southeast-2","ap-southeast-3","ap-southeast-4","ap-southeast-5","ca-central-1","ca-west-1","cn-north-1","cn-northwest-1","eu-central-1","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-1","eu-west-2","eu-west-3","il-central-1","me-central-1","me-south-1","sa-east-1","us-east-1","us-east-2","us-gov-east-1","us-gov-west-1","us-west-1","us-west-2"]}},"required":["provider","bucket","base_prefix","region"]},"AzureDataConnection":{"type":"object","properties":{"provider":{"type":"string","enum":["az"]},"account_name":{"type":"string"},"container_name":{"type":"string"},"base_prefix":{"type":"string"},"region":{"type":"string","enum":["westeurope"]}},"required":["provider","account_name","container_name","base_prefix","region"]},"DataConnectionDetails":{"oneOf":[{"$ref":"#/components/schemas/S3DataConnection"},{"$ref":"#/components/schemas/AzureDataConnection"}],"discriminator":{"propertyName":"provider","mapping":{"s3":"#/components/schemas/S3DataConnection","az":"#/components/schemas/AzureDataConnection"}}},"S3AccessKeyAuthentication":{"type":"object","properties":{"type":{"type":"string","enum":["s3_access_key"]},"access_key_id":{"type":"string"},"secret_access_key":{"type":"string"}},"required":["type","access_key_id","secret_access_key"]},"AzureSasTokenAuthentication":{"type":"object","properties":{"type":{"type":"string","enum":["az_sas_token"]},"sas_token":{"type":"string"}},"required":["type","sas_token"]},"DataConnectionAuthentication":{"oneOf":[{"$ref":"#/components/schemas/S3AccessKeyAuthentication"},{"$ref":"#/components/schemas/AzureSasTokenAuthentication"}],"discriminator":{"propertyName":"type","mapping":{"s3_access_key":"#/components/schemas/S3AccessKeyAuthentication","az_sas_token":"#/components/schemas/AzureSasTokenAuthentication"}}},"DataConnection":{"type":"object","properties":{"data_connection_id":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[a-z0-9](?:(?!--)[a-z0-9-])*[a-z0-9]$","example":"data-connection-id"},"name":{"type":"string"},"prefix_template":{"type":"string"},"read_only":{"type":"boolean"},"allowed_data_modes":{"type":"array","items":{"type":"string","enum":["open","subscription","private"]}},"required_flag":{"type":"string","enum":["admin","create_repositories","create_organizations"]},"details":{"$ref":"#/components/schemas/DataConnectionDetails"},"authentication":{"$ref":"#/components/schemas/DataConnectionAuthentication"}},"required":["data_connection_id","name","read_only","allowed_data_modes","details"]},"RepositoryDataMode":{"type":"string","enum":["open","subscription","private"]},"RepositoryMeta":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"tags":{"type":"string"}},"required":["title","description","tags"]},"RepositoryCreationRequest":{"type":"object","properties":{"repository_id":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[a-z0-9](?:(?!--)[a-z0-9-])*[a-z0-9]$"},"data_mode":{"$ref":"#/components/schemas/RepositoryDataMode"},"meta":{"$ref":"#/components/schemas/RepositoryMeta"},"data_connection_id":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[a-z0-9](?:(?!--)[a-z0-9-])*[a-z0-9]$","example":"data-connection-id"}},"required":["repository_id","data_mode","meta","data_connection_id"]},"RepositoryState":{"type":"string","enum":["listed","unlisted"]},"RepositoryMirror":{"type":"object","properties":{"data_connection_id":{"type":"string"},"prefix":{"type":"string"}},"required":["data_connection_id","prefix"]},"RepositoryData":{"type":"object","properties":{"primary_mirror":{"type":"string"},"mirrors":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/RepositoryMirror"}}},"required":["primary_mirror","mirrors"]},"Repository":{"type":"object","properties":{"account_id":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[a-z0-9](?:(?!--)[a-z0-9-])*[a-z0-9]$"},"repository_id":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[a-z0-9](?:(?!--)[a-z0-9-])*[a-z0-9]$"},"state":{"$ref":"#/components/schemas/RepositoryState"},"data_mode":{"$ref":"#/components/schemas/RepositoryDataMode"},"featured":{"type":"integer","enum":[1,0]},"meta":{"$ref":"#/components/schemas/RepositoryMeta"},"data":{"$ref":"#/components/schemas/RepositoryData"},"published":{"type":"string","format":"date-time"},"disabled":{"type":"boolean"}},"required":["account_id","repository_id","state","data_mode","featured","meta","data","published","disabled"]},"RepositoryUpdateRequest":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/RepositoryMeta"},"state":{"$ref":"#/components/schemas/RepositoryState"}},"required":["meta","state"]},"RepositoryListResponse":{"type":"object","properties":{"repositories":{"type":"array","items":{"$ref":"#/components/schemas/Repository"}},"next":{"type":"string"}},"required":["repositories"]},"RepositoryFeaturedUpdateRequest":{"type":"object","properties":{"featured":{"type":"integer","enum":[1,0]}},"required":["featured"]}}},"tags":[],"security":[{"ApiKeyAuth":[]}]}