diff --git a/docs/openapi/api.yaml b/docs/openapi/api.yaml index 8a1d3537..8b934960 100644 --- a/docs/openapi/api.yaml +++ b/docs/openapi/api.yaml @@ -113,6 +113,10 @@ paths: $ref: './site-metrics-api.yaml#/site-metrics-by-source' /sites/{siteId}/experiments: $ref: './experiments-api.yaml#/experiments' + /sites/{siteId}/redirects: + $ref: './site-api.yaml#/redirects-for-site' + /sites/{siteId}/metatdata: + $ref: './site-api.yaml#/metadata-for-site' /slack/channels/invite-by-user-id: $ref: './slack-api.yaml#/invite-by-user-id' /trigger: diff --git a/docs/openapi/schemas.yaml b/docs/openapi/schemas.yaml index e8c5e53a..f53ef469 100644 --- a/docs/openapi/schemas.yaml +++ b/docs/openapi/schemas.yaml @@ -1279,3 +1279,87 @@ ScrapeResult: - url: 'https://example.com/fr/page2' status: 'FAILED' error: 'Timeout' +FixedURLs: + properties: + fixedURLs: + description: Set of urls that were fixed. + type: array + items: + type: object + properties: + sourceURL: + description: The broken backlink URL + type: string + destinationURL: + description: The target for the broken backlink included in redirects.xslx + type: string +Metadata: + properties: + metadata: + description: Set of key value pairs to be added to the metadata table. + type: array + items: + type: object + properties: + key: + description: The metadata key propertu + type: string + value: + description: The metadata value property + type: string +MultiStatusItem: + type: object + required: + - status + properties: + status: + type: integer + minimum: 200 + maximum: 600 + example: 400 + message: + type: string + example: "Not found" +MultiStatusMetadata: + type: object + required: + - failure + - success + - total + properties: + failure: + type: integer + minimum: 0 + example: 1 + success: + type: integer + minimum: 0 + example: 3 + total: + type: integer + minimum: 0 + example: 4 +MultiStatusResponse: + type: object + required: + - payload + properties: + payload: + type: object + required: + - items + - metadata + properties: + items: + type: array + description: A list of multi status response items + items: + $ref: '#/MultiStatusItem' + metadata: + $ref: '#/MultiStatusMetadata' +MultiStatus: + description: Multi-Status + content: + application/json: + schema: + $ref: '#/MultiStatusResponse' diff --git a/docs/openapi/site-api.yaml b/docs/openapi/site-api.yaml index bb84c1e8..fe8a7455 100644 --- a/docs/openapi/site-api.yaml +++ b/docs/openapi/site-api.yaml @@ -105,3 +105,69 @@ site: $ref: './responses.yaml#/404-site-not-found-with-id' '500': $ref: './responses.yaml#/500' +redirects-for-site: + parameters: + - $ref: './parameters.yaml#/siteId' + patch: + tags: + - site + summary: Publish redirects for a site + description: | + This endpoint is useful for publishing fixed URLs to the site document based authoring. + operationId: publishRedirectsForSite + requestBody: + required: true + content: + application/json: + schema: + $ref: './schemas.yaml#/FixedURLs' + responses: + '207': + description: The URLs that were successfully addeed to redirects and the URLs that failed + content: + application/json: + schema: + $ref: './schemas.yaml#/MultiStatus' + '400': + $ref: './responses.yaml#/400' + '401': + $ref: './responses.yaml#/401' + '404': + $ref: './responses.yaml#/404-audit-not-found' + '500': + $ref: './responses.yaml#/500' + security: + - api_key: [ ] +metadata-for-site: + parameters: + - $ref: './parameters.yaml#/siteId' + patch: + tags: + - site + summary: Publish redirects for a site + description: | + This endpoint is useful for publishing fixed URLs to the site document based authoring. + operationId: publishRedirectsForSite + requestBody: + required: true + content: + application/json: + schema: + $ref: './schemas.yaml#/Metadata' + responses: + '200': + description: The updated audit type config object + content: + application/json: + schema: + $ref: './schemas.yaml#/MultiStatus' + '400': + $ref: './responses.yaml#/400' + '401': + $ref: './responses.yaml#/401' + '404': + $ref: './responses.yaml#/404-audit-not-found' + '500': + $ref: './responses.yaml#/500' + security: + - api_key: [ ]