openapi: 3.2.0 info: description: SafeBase API documentation. version: 1.4.1 title: SafeBase API documentation Account Members API contact: email: support@safebase.io servers: - url: https://app.safebase.io/api/ext/v1/rest security: - apiKey: [] tags: - name: Account Members paths: /accounts/members: get: tags: - Account Members summary: Search for members description: Search for a member based on account criteria and member criteria operationId: searchForAccountMembers parameters: - in: query name: email description: This parameter will search for all accounts that contain a given member email. schema: type: string - in: query name: sfdcAccountId description: Salesforce Account Id to verify and get account schema: type: string responses: '201': description: Successful operation content: application/json: schema: type: object properties: ok: type: boolean example: true result: type: array items: $ref: '#/components/schemas/AccountMemberResponse' '400': $ref: '#/components/responses/400' '403': $ref: '#/components/responses/403' '404': $ref: '#/components/responses/404' '405': $ref: '#/components/responses/405' security: - apiKey: - accounts:view /accounts/{id}/members: post: tags: - Account Members summary: Add a member description: Adds a member to an account operationId: addMemberToAccount requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AccountMemberPayloadArray' parameters: - $ref: '#/components/parameters/accountId' responses: '201': description: Successful operation content: application/json: schema: type: object properties: ok: type: boolean example: true result: $ref: '#/components/schemas/AccountMemberArrayResponse' '400': $ref: '#/components/responses/400' '403': $ref: '#/components/responses/403' '404': $ref: '#/components/responses/404' '405': $ref: '#/components/responses/405' security: - apiKey: - accounts:edit delete: tags: - Account Members summary: Delete a member description: Deletes a member from an account operationId: deleteMemberFromAccount requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AccountMemberEmails' parameters: - $ref: '#/components/parameters/accountId' responses: '200': description: Successful operation content: application/json: schema: type: object properties: ok: type: boolean example: true '400': $ref: '#/components/responses/400' '403': $ref: '#/components/responses/403' '404': $ref: '#/components/responses/404' '405': $ref: '#/components/responses/405' security: - apiKey: - accounts:edit /accounts/{id}/members/notify: post: tags: - Account Members summary: Notify a member description: "Sends an email invitation to an account member. \n\n**email**: This parameter can be a single email (string) to notify one member, or an array of emails (string[]) to notify multiple members. \n\n**message** (optional): This parameter allows you to send a custom message in an invitation email." operationId: accountMemberNotify requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AccountMemberNotifyPayload' parameters: - $ref: '#/components/parameters/accountId' responses: '200': description: Successful operation content: application/json: schema: type: object properties: ok: type: boolean example: true '400': $ref: '#/components/responses/400' '403': $ref: '#/components/responses/403' '404': $ref: '#/components/responses/404' '405': $ref: '#/components/responses/405' security: - apiKey: - accounts:edit components: schemas: AccountMemberResponse: type: object properties: accountId: type: string example: 88f54931-f4c6-454e-8c3d-1462df981b4d firstName: type: string example: Safe lastName: type: string example: Base name: type: string example: Safe Base deprecated: true email: type: string example: user@safebase.io createdAt: type: string format: date-time example: '2017-07-21T17:32:28Z' lastSeen: oneOf: - type: 'null' - type: string format: date-time example: '2017-07-21T17:32:28Z' AccountMemberNotifyPayload: type: object required: - email properties: email: oneOf: - $ref: '#/components/schemas/AccountMemberEmail' description: One single email address can be entered here - $ref: '#/components/schemas/AccountMemberEmails' description: An array of email addresses can be entered here message: description: "This parameter allows you to send a custom message. It can be set to one of the following options: \n\n1. string - Sends a Safebase email with a custom message attached \n\n2. boolean - Set this parameter to 'true' to send a SafeBase email without any custom message \n\n3. undefined - If you do not wish to send a Safebase email, simply do not send this property as part of your request" oneOf: - type: string description: Enter the 'string' option here - type: boolean description: Enter the 'boolean' option here example: This is a custom message notify: type: object itemUid: description: This is a parameter to be able to send a link directly to a specific Item on the Portal type: string format: uuid productId: description: The specific product to link to type: string AccountMemberEmails: type: object required: - members properties: members: type: array description: Array of member emails to delete minItems: 1 uniqueItems: true example: - user1@safebase.io - user2@safebase.io items: type: string ApiResponseInvalidApiKeyOrMissingScope: type: object properties: statusCode: type: integer example: 403 error: type: string example: forbidden message: type: string example: 'Invalid API key / Missing required scope(s): (missing scopes here)' ApiResponseInvalidRequest: type: object properties: statusCode: type: integer example: 400 error: type: string example: bad_request message: type: string example: Invalid request. ApiResponseNotFound: type: object properties: statusCode: type: integer example: 404 error: type: string example: not_found message: type: string example: Not found AccountMemberArrayResponse: type: array items: type: object $ref: '#/components/schemas/AccountMemberResponse' AccountMemberEmail: type: string example: user1@safebase.io AccountMemberPayloadArray: type: object required: - members properties: members: description: An array of objects, each representing a member to add to an account type: array minItems: 1 items: type: object $ref: '#/components/schemas/AccountMemberPayload' message: description: "This parameter allows you to send a custom message. It can be set to one of the following options: \n\n1. string - Sends a Safebase email with a custom message attached \n\n2. boolean - Set this parameter to 'true' to send a SafeBase email without any custom message \n\n3. undefined - If you do not wish to send a Safebase email, simply do not send this property as part of your request" oneOf: - type: string description: Enter the 'string' option here - type: boolean description: Enter the 'boolean' option here example: This is a custom message AccountMemberPayload: type: object required: - email properties: firstName: type: string example: Safe description: Required if name is not set. lastName: type: string example: Base description: Required if name is not set. name: type: string example: Safe Base description: Either firstName and lastName, or name must be supplied, but never all three. deprecated: true email: type: string example: user@safebase.io responses: '400': description: Invalid request content: application/json: schema: $ref: '#/components/schemas/ApiResponseInvalidRequest' '405': description: Method not allowed content: application/json: schema: $ref: '#/components/schemas/ApiResponseNotFound' '404': description: Not found or no access content: application/json: schema: $ref: '#/components/schemas/ApiResponseNotFound' '403': description: Invalid api key / missing scope content: application/json: schema: $ref: '#/components/schemas/ApiResponseInvalidApiKeyOrMissingScope' parameters: accountId: name: id in: path required: true schema: description: The target account ID type: string format: uuid securitySchemes: apiKey: type: apiKey name: x-sb-api-key in: header