openapi: 3.0.0 info: title: Indexing Service version: v1 description: | The indexing service allows you to manage indexing configuration. Currently supported index providers: * Algolia - https://www.algolia.com contact: email: documentation@emporix.com servers: - url: 'https://api.emporix.io' paths: '/indexing/{tenant}/configurations': post: summary: Create a new configuration description: |- Creates a new index configuration. Currently supported providers: * Algolia - https://www.algolia.com Identifier of a newly created configuration is a provider name. security: - OAuth2: - indexing.search_manage parameters: - $ref: '#/components/parameters/trait_tenant' requestBody: content: application/json: schema: $ref: '#/components/schemas/IndexConfiguration' examples: Create a new configuration: value: active: true searchKey: 84dc4886f81f805c42bdd89d64de751a applicationId: 8AP2HABA2I indexName: exampleTenant writeKey: 51ebe89215dddcf85e5dacd5643d17e7 provider: ALGOLIA description: '' responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/IndexCreationResponse' examples: Creation Response: value: id: ALGOLIA '400': $ref: '#/components/responses/BadRequest_400' '401': $ref: '#/components/responses/Unauthorized_401' '403': $ref: '#/components/responses/Forbidden_403' operationId: POST-indexing-create-config tags: - Configuration get: summary: Get all configurations description: Retrieves all configurations of index providers. The returned response contains search and write keys. security: - OAuth2: - indexing.search_view parameters: - $ref: '#/components/parameters/trait_tenant' responses: '200': description: '' content: application/json: examples: Get all configurations: value: - active: true searchKey: 84dc4886f81f805c42bdd89d64de751a applicationId: 8AP2HABA2I indexName: exampleTenant writeKey: 51ebe89215dddcf85e5dacd5643d17e7 provider: ALGOLIA schema: type: array items: $ref: '#/components/schemas/IndexConfiguration' '401': $ref: '#/components/responses/Unauthorized_401' '403': $ref: '#/components/responses/Forbidden_403' operationId: GET-indexing-list-configs tags: - Configuration parameters: - schema: type: string name: tenant in: path required: true '/indexing/{tenant}/configurations/{provider}': get: summary: Get configuration by provider name description: |- Retrieves a single configuration by a provider name. Currently supported providers: * Algolia - https://www.algolia.com security: - OAuth2: - indexing.search_view parameters: [] responses: '200': description: '' content: application/json: examples: Get configuration: value: active: true searchKey: 84dc4886f81f805c42bdd89d64de751a applicationId: 8AP2HABA2I indexName: exampleTenant writeKey: 51ebe89215dddcf85e5dacd5643d17e7 provider: ALGOLIA schema: $ref: '#/components/schemas/IndexConfiguration' '401': $ref: '#/components/responses/Unauthorized_401' '403': $ref: '#/components/responses/Forbidden_403' '404': $ref: '#/components/responses/NotFound_404' tags: - Configuration operationId: GET-indexing-retrieve-config put: summary: Update configuration by provider name description: Updates an existing index configuration. security: - OAuth2: - indexing.search_manage parameters: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/IndexConfiguration' examples: Configuration update: value: active: true searchKey: 84dc4886f81f805c42bdd89d64de751a applicationId: 8AP2HABA2I indexName: exampleTenant writeKey: 51ebe89215dddcf85e5dacd5643d17e7 provider: ALGOLIA responses: '204': description: Configuration updated '400': $ref: '#/components/responses/BadRequest_400' '403': $ref: '#/components/responses/Forbidden_403' '404': $ref: '#/components/responses/NotFound_404' operationId: PUT-indexing-update-config tags: - Configuration delete: summary: Delete configuration description: Deletes the configuration based on the provider name. security: - OAuth2: - indexing.search_manage parameters: - $ref: '#/components/parameters/trait_tenant' responses: '204': description: Configuration deleted '401': $ref: '#/components/responses/Unauthorized_401' '403': $ref: '#/components/responses/Forbidden_403' '404': $ref: '#/components/responses/NotFound_404' operationId: DELETE-indexing-remove-config tags: - Configuration parameters: - name: tenant in: path required: true description: | The tenant that the caller is acting upon. Please note that this value is always lowercase. schema: pattern: '^[a-z][a-z0-9]+$' minLength: 3 maxLength: 16 type: string - $ref: '#/components/parameters/trait_provider' '/indexing/{tenant}/public/configurations': parameters: - $ref: '#/components/parameters/trait_tenant' get: summary: Get all public configurations tags: - Public Configuration responses: '200': description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/IndexPublicConfiguration' examples: Public configurations: value: - active: true searchKey: 84dc4886f81f805c42bdd89d64de751a applicationId: 8AP2HABA2I indexName: exampleTenant provider: ALGOLIA '401': description: Unauthorized operationId: GET-indexing-list-public-configs description: Retrieves all configurations of index providers. The returned response contains only search keys. Write keys are not returned. security: - OAuth2: [] '/indexing/{tenant}/public/configurations/{provider}': parameters: - $ref: '#/components/parameters/trait_tenant' - $ref: '#/components/parameters/trait_provider' get: summary: Get public configuration tags: - Public Configuration responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/IndexPublicConfiguration' examples: Public configuration: value: active: true searchKey: 84dc4886f81f805c42bdd89d64de751a applicationId: 8AP2HABA2I indexName: exampleTenant provider: ALGOLIA '401': $ref: '#/components/responses/Unauthorized_401' '404': $ref: '#/components/responses/NotFound_404' operationId: GET-indexing-retrieve-public-config description: |- Retrieves a single public configuration by a provider name. Currently supported providers: * Algolia - https://www.algolia.com security: - OAuth2: [] '/indexing/{tenant}/reindex': parameters: - schema: type: string name: tenant in: path required: true post: summary: Reindex operationId: POST-indexing-reindex responses: '204': description: '' '400': $ref: '#/components/responses/BadRequest_400' '401': $ref: '#/components/responses/Unauthorized_401' '403': $ref: '#/components/responses/Forbidden_403' tags: - Reindex description: |- Triggers indexing process of products for the tenant. The reindex works with a `FULL` mode - all products are reindexed. security: - OAuth2: - indexing.search_manage requestBody: content: application/json: schema: $ref: '#/components/schemas/Reindex' examples: Reindex request: value: mode: FULL components: schemas: errorMessage: title: error description: Schema for API specified errors. type: object properties: code: description: 'Original HTTP error code, should be consistent with the response HTTP code' type: integer status: description: Classification of the error type type: string message: description: Descriptive error message for debugging type: string details: type: array description: Error details items: type: string IndexPublicConfiguration: title: IndexPublicConfiguration type: object properties: searchKey: type: string description: API Key used for search purposes. applicationId: type: string description: Application id of an indexer provider. indexName: type: string description: Identifier of an index. provider: type: string description: 'Index provider name. Supported providers: Algolia - https://www.algolia.com' enum: - ALGOLIA active: type: boolean description: Indicates if the configuration is active or not. IndexConfiguration: title: IndexConfiguration allOf: - $ref: '#/components/schemas/IndexPublicConfiguration' - type: object properties: writeKey: type: string description: API key used for write purposes. IndexCreationResponse: title: IndexCreationResponse type: object properties: id: type: string description: Identifier of a newly created configuration. Reindex: title: Reindex type: object properties: mode: type: string enum: - FULL description: 'Indicates reindex mode. Supported modes: `FULL`.' responses: Forbidden_403: description: Given authorization scopes are not sufficient and do not match scopes required by the endpoint. content: application/json: schema: $ref: '#/components/schemas/errorMessage' examples: ForbiddenExample: value: status: Forbidden details: - 'Missing required scopes ''[indexing.search_view]''' code: 403 message: Scope validation failed Unauthorized_401: description: Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload. content: application/json: schema: type: object properties: fault: type: object properties: faultstring: type: string detail: type: object properties: errorcode: type: string examples: UnauthorizedExample: value: fault: faultstring: Invalid access token detail: errorcode: oauth.v2.InvalidAccessToken AccessTokenExpiredExample: value: fault: faultstring: Access Token expired detail: errorcode: keymanagement.service.access_token_expired BadRequest_400: description: Request was syntactically incorrect. Details will be provided in the response payload. content: application/json: schema: $ref: '#/components/schemas/errorMessage' examples: Example 1: value: code: 400 status: Bad Request message: The provider ALGOLIA2 is not supported. NotFound_404: description: Resource has not been found. content: application/json: schema: $ref: '#/components/schemas/errorMessage' examples: Not found: value: code: 404 status: Not Found message: The provider ALGOLIA2 is not supported. parameters: trait_tenant: name: tenant in: path required: true description: | The tenant that the caller is acting upon. Please note that this value is always lowercase. schema: pattern: '^[a-z][a-z0-9]+$' minLength: 3 maxLength: 16 type: string trait_provider: name: provider in: path required: true schema: type: string description: 'Provider name. Currently supported providers: ALGOLIA' securitySchemes: OAuth2: type: oauth2 flows: clientCredentials: tokenUrl: 'https://api.emporix.io/oauth/token' scopes: indexing.search_view: Needed to read an index provider configuration indexing.search_manage: Needed to manage an index provider configuration examples: {} requestBodies: {} security: - OAuth2: - indexing.search_manage - indexing.search_view tags: - name: Configuration - name: Public Configuration - name: Reindex