openapi: 3.0.1 info: title: Safe to run description: The safe to run API can be used to request a list of a users organisations version: "1.0" servers: - url: https://app.safetorun.com paths: /organisation: get: summary: Returns a list of all organisations a user has access to operationId: listOrganisations responses: "200": description: A list of all orgs is returned content: application/json: schema: $ref: '#/components/schemas/OrganisationResponse' post: summary: Creates a new organisation operationId: createOrganisation requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateOrganisationRequest' required: true responses: "200": description: The created organisation is returned content: application/json: schema: $ref: '#/components/schemas/Organisation' /organisation/{organisationId}: delete: summary: Delete an organisation operationId: deleteOrganisation parameters: - name: organisationId in: path required: true schema: type: string responses: "204": description: Organisation deleted /{organisationId}/application: get: summary: Returns a list of all applications for a given organisation operationId: listApplications parameters: - name: organisationId in: path required: true schema: type: string responses: "200": description: A list of all applications for an organisation content: application/json: schema: type: array items: $ref: '#/components/schemas/Application' post: summary: Creates a new application for a given organisation operationId: createApplication parameters: - name: organisationId in: path required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateApplicationRequest' required: true responses: "200": description: The newly created application /{organisationId}/application/{applicationId}: delete: summary: Delete an application for a given organisation operationId: deleteApplication parameters: - name: organisationId in: path required: true schema: type: string - name: applicationId in: path required: true schema: type: string responses: "204": description: Application deleted /{organisationId}/application/{organisationId}/{applicationId}/integrate: get: summary: Integrate your application with safe to run operationId: integrate parameters: - name: organisationId in: path required: true schema: type: string - name: applicationId in: path required: true schema: type: string responses: "200": description: Instructions on safe to run content: application/json: schema: $ref: '#/components/schemas/IntegrationResponse' components: schemas: Application: required: - apiKey - applicationId - applicationName type: object properties: applicationId: type: string applicationName: type: string apiKey: type: string CreateApplicationRequest: required: - applicationName type: object properties: applicationName: type: string CreateOrganisationRequest: required: - organisationName - organisationUid type: object properties: organisationName: type: string organisationUid: type: string IntegrationResponse: required: - codeResponse - gradleImport type: object properties: gradleImport: type: string codeResponse: type: string Organisation: required: - applications - organisationName - organisationUid - selected type: object properties: organisationUid: type: string organisationName: type: string selected: type: boolean applications: type: array items: $ref: '#/components/schemas/Application' OrganisationResponse: required: - organisations type: object properties: organisations: type: array items: $ref: '#/components/schemas/Organisation'