# Redirect

## List all the redirection associated to this tenant

> Returns all configured redirects for the tenant (both active and expired) as an async enumerable stream.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Redirect"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["ScopedAuthorizeRequirement"]},{"apiKey":["ScopedAuthorizeRequirement"]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"WebRedirectEntity":{"required":["id","layout","uri"],"type":"object","properties":{"id":{"type":"string","description":"Identifier of the redirect"},"layout":{"type":"string","description":"Layout associated to this redirect"},"creationDate":{"type":"string","description":"Creation date of this redirect","format":"date-time"},"parameters":{"type":"object","additionalProperties":{"type":"string"},"description":"Optional parameters to add to the layout url"},"options":{"description":"Additional options for this redirect","$ref":"#/components/schemas/WebRedirectOptions"},"uri":{"type":"string","description":"Short uri of the redirection uri"}},"additionalProperties":false},"WebRedirectOptions":{"type":"object","properties":{"expirationDate":{"type":["null","string"],"description":"Date when the link will be expired. If a user access an expired link he will obtian a 404","format":"date-time"},"label":{"type":["null","string"],"description":"Optional friendly name of this redirect"},"length":{"type":"integer","description":"Size of the small uri, minLength is 6.","format":"int32"}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/redirect":{"get":{"tags":["Redirect"],"summary":"List all the redirection associated to this tenant","description":"Returns all configured redirects for the tenant (both active and expired) as an async enumerable stream.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"List of all redirection","content":{"text/plain":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebRedirectEntity"}}},"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebRedirectEntity"}}},"text/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebRedirectEntity"}}}}},"401":{"description":"Not authorized","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"500":{"description":"Internal server error while listing redirects"}}}}}}
```

## Create a new redirect

> Creates a new redirect with the specified layout, parameters, and optional configuration (expiration date, label, URL length).

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Redirect"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["ScopedAuthorizeRequirement"]},{"apiKey":["ScopedAuthorizeRequirement"]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"CreateOrUpdateModel":{"required":["layout"],"type":"object","properties":{"layout":{"minLength":1,"type":"string","description":"Name of the layout to create a redirection for"},"parameters":{"type":"object","additionalProperties":{"type":"string"},"description":"List of parameters that should be included in the uri"},"options":{"description":"Additional options for this redirect","$ref":"#/components/schemas/WebRedirectOptions"}},"additionalProperties":false},"WebRedirectOptions":{"type":"object","properties":{"expirationDate":{"type":["null","string"],"description":"Date when the link will be expired. If a user access an expired link he will obtian a 404","format":"date-time"},"label":{"type":["null","string"],"description":"Optional friendly name of this redirect"},"length":{"type":"integer","description":"Size of the small uri, minLength is 6.","format":"int32"}},"additionalProperties":false},"WebRedirectEntity":{"required":["id","layout","uri"],"type":"object","properties":{"id":{"type":"string","description":"Identifier of the redirect"},"layout":{"type":"string","description":"Layout associated to this redirect"},"creationDate":{"type":"string","description":"Creation date of this redirect","format":"date-time"},"parameters":{"type":"object","additionalProperties":{"type":"string"},"description":"Optional parameters to add to the layout url"},"options":{"description":"Additional options for this redirect","$ref":"#/components/schemas/WebRedirectOptions"},"uri":{"type":"string","description":"Short uri of the redirection uri"}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/redirect":{"post":{"tags":["Redirect"],"summary":"Create a new redirect","description":"Creates a new redirect with the specified layout, parameters, and optional configuration (expiration date, label, URL length).","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The redirection link to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateModel"}},"text/json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateModel"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateModel"}}}},"responses":{"201":{"description":"Returns the newly created item","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/WebRedirectEntity"}},"application/json":{"schema":{"$ref":"#/components/schemas/WebRedirectEntity"}},"text/json":{"schema":{"$ref":"#/components/schemas/WebRedirectEntity"}}}},"401":{"description":"Not authorized","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"500":{"description":"Internal server error while creating redirect"}}}}}}
```

## Get detail of a specific redirection

> Retrieves full details of a redirect including its layout, parameters, and configuration options.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Redirect"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["ScopedAuthorizeRequirement"]},{"apiKey":["ScopedAuthorizeRequirement"]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"WebRedirectEntity":{"required":["id","layout","uri"],"type":"object","properties":{"id":{"type":"string","description":"Identifier of the redirect"},"layout":{"type":"string","description":"Layout associated to this redirect"},"creationDate":{"type":"string","description":"Creation date of this redirect","format":"date-time"},"parameters":{"type":"object","additionalProperties":{"type":"string"},"description":"Optional parameters to add to the layout url"},"options":{"description":"Additional options for this redirect","$ref":"#/components/schemas/WebRedirectOptions"},"uri":{"type":"string","description":"Short uri of the redirection uri"}},"additionalProperties":false},"WebRedirectOptions":{"type":"object","properties":{"expirationDate":{"type":["null","string"],"description":"Date when the link will be expired. If a user access an expired link he will obtian a 404","format":"date-time"},"label":{"type":["null","string"],"description":"Optional friendly name of this redirect"},"length":{"type":"integer","description":"Size of the small uri, minLength is 6.","format":"int32"}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/redirect/{id}":{"get":{"tags":["Redirect"],"summary":"Get detail of a specific redirection","description":"Retrieves full details of a redirect including its layout, parameters, and configuration options.","parameters":[{"name":"id","in":"path","description":"id of the redirection","required":true,"schema":{"minLength":3,"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"return the specified item","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/WebRedirectEntity"}},"application/json":{"schema":{"$ref":"#/components/schemas/WebRedirectEntity"}},"text/json":{"schema":{"$ref":"#/components/schemas/WebRedirectEntity"}}}},"401":{"description":"Not authorized","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"If the item does not exists","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"500":{"description":"Internal server error while retrieving redirect"}}}}}}
```

## Update a specific redirection. All properties will be overwritten by the new entity.

> Replaces the entire redirect configuration (PUT operation). All properties must be provided.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Redirect"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["ScopedAuthorizeRequirement"]},{"apiKey":["ScopedAuthorizeRequirement"]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"CreateOrUpdateModel":{"required":["layout"],"type":"object","properties":{"layout":{"minLength":1,"type":"string","description":"Name of the layout to create a redirection for"},"parameters":{"type":"object","additionalProperties":{"type":"string"},"description":"List of parameters that should be included in the uri"},"options":{"description":"Additional options for this redirect","$ref":"#/components/schemas/WebRedirectOptions"}},"additionalProperties":false},"WebRedirectOptions":{"type":"object","properties":{"expirationDate":{"type":["null","string"],"description":"Date when the link will be expired. If a user access an expired link he will obtian a 404","format":"date-time"},"label":{"type":["null","string"],"description":"Optional friendly name of this redirect"},"length":{"type":"integer","description":"Size of the small uri, minLength is 6.","format":"int32"}},"additionalProperties":false},"WebRedirectEntity":{"required":["id","layout","uri"],"type":"object","properties":{"id":{"type":"string","description":"Identifier of the redirect"},"layout":{"type":"string","description":"Layout associated to this redirect"},"creationDate":{"type":"string","description":"Creation date of this redirect","format":"date-time"},"parameters":{"type":"object","additionalProperties":{"type":"string"},"description":"Optional parameters to add to the layout url"},"options":{"description":"Additional options for this redirect","$ref":"#/components/schemas/WebRedirectOptions"},"uri":{"type":"string","description":"Short uri of the redirection uri"}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/redirect/{id}":{"put":{"tags":["Redirect"],"summary":"Update a specific redirection. All properties will be overwritten by the new entity.","description":"Replaces the entire redirect configuration (PUT operation). All properties must be provided.","parameters":[{"name":"id","in":"path","description":"Identifier of the redirection to update.","required":true,"schema":{"minLength":3,"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The redirection to update.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateModel"}},"text/json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateModel"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateModel"}}}},"responses":{"201":{"description":"Returns the updated item","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/WebRedirectEntity"}},"application/json":{"schema":{"$ref":"#/components/schemas/WebRedirectEntity"}},"text/json":{"schema":{"$ref":"#/components/schemas/WebRedirectEntity"}}}},"204":{"description":"if the item to update has not been found"},"401":{"description":"Not authorized","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"500":{"description":"Internal server error while updating redirect"}}}}}}
```

## Delete the requested redirection

> Removes the redirect from the system and returns the deleted entity for confirmation.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Redirect"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["ScopedAuthorizeRequirement"]},{"apiKey":["ScopedAuthorizeRequirement"]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"WebRedirectEntity":{"required":["id","layout","uri"],"type":"object","properties":{"id":{"type":"string","description":"Identifier of the redirect"},"layout":{"type":"string","description":"Layout associated to this redirect"},"creationDate":{"type":"string","description":"Creation date of this redirect","format":"date-time"},"parameters":{"type":"object","additionalProperties":{"type":"string"},"description":"Optional parameters to add to the layout url"},"options":{"description":"Additional options for this redirect","$ref":"#/components/schemas/WebRedirectOptions"},"uri":{"type":"string","description":"Short uri of the redirection uri"}},"additionalProperties":false},"WebRedirectOptions":{"type":"object","properties":{"expirationDate":{"type":["null","string"],"description":"Date when the link will be expired. If a user access an expired link he will obtian a 404","format":"date-time"},"label":{"type":["null","string"],"description":"Optional friendly name of this redirect"},"length":{"type":"integer","description":"Size of the small uri, minLength is 6.","format":"int32"}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/redirect/{id}":{"delete":{"tags":["Redirect"],"summary":"Delete the requested redirection","description":"Removes the redirect from the system and returns the deleted entity for confirmation.","parameters":[{"name":"id","in":"path","description":"Identifier of the redirection to delete","required":true,"schema":{"minLength":3,"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"When the object has been successfully deleted","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/WebRedirectEntity"}},"application/json":{"schema":{"$ref":"#/components/schemas/WebRedirectEntity"}},"text/json":{"schema":{"$ref":"#/components/schemas/WebRedirectEntity"}}}},"204":{"description":"if the item to delete has not been found"},"401":{"description":"Not authorized","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"500":{"description":"Internal server error while deleting redirect"}}}}}}
```
