{"files":{"SKILL.md":"---\nname: redirection-io\ndescription: \"redirection.io API skill. Use when working with redirection.io for domains, drafts, instances. Covers 24 endpoints.\"\nversion: 1.0.0\ngenerator: lapsh\n---\n\n# redirection.io\nAPI version: 2.0.0\n\n## Auth\nBearer bearer | ApiKey Authorization in header\n\n## Base URL\nhttps://api.redirection.io/\n\n## Setup\n1. Set Authorization header with your Bearer token\n2. GET /domains -- verify access\n3. POST /domains -- create first domains\n\n## Endpoints\n\n24 endpoints across 8 groups. See references/api-spec.lap for full details.\n\n### domains\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /domains | Retrieves the collection of the domains. |\n| POST | /domains | Creates a new domain |\n| DELETE | /domains/{id} | Permanently deletes a domain |\n| GET | /domains/{id} | Retrieves a ProjectDomain resource. |\n\n### drafts\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /drafts | Retrieves the collection of Draft rules |\n| DELETE | /drafts/{id} | Deletes a Draft |\n| GET | /drafts/{id} | Retrieves a Draft resource. |\n\n### instances\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /instances | List project instances |\n| DELETE | /instances/{id} | Delete an instance |\n| GET | /instances/{id} | Retrieves a Instance resource. |\n\n### ips\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /ips | Retrieves the collection of Ip resources. |\n\n### organization\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /organization | Retrieve the details of your organization |\n\n### projects\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /projects | Retrieves the collection of Project resources. |\n| POST | /projects | Creates a new project |\n| DELETE | /projects/{id} | Permanently deletes a project |\n| GET | /projects/{id} | Retrieves a Project resource. |\n| POST | /projects/{id}/publish | Publishes the collection of Draft resources |\n\n### redirections\n| Method | Path | Description |\n|--------|------|-------------|\n| POST | /redirections | Creates a new Redirection |\n\n### rules\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /rules | Retrieves the collection of currently published Rule resources. |\n| POST | /rules | Creates a new draft Rule |\n| DELETE | /rules/{id} | Deletes a Rule |\n| GET | /rules/{id} | Retrieves a Rule resource |\n| PUT | /rules/{id} | Updates an existing Rule |\n| GET | /rules/{id}/statistics | Retrieves the usage statistics of a rule. |\n\n## Common Questions\n\nMatch user requests to endpoints in references/api-spec.lap. Key patterns:\n- \"List all domains?\" -> GET /domains\n- \"Create a domain?\" -> POST /domains\n- \"Delete a domain?\" -> DELETE /domains/{id}\n- \"Get domain details?\" -> GET /domains/{id}\n- \"List all drafts?\" -> GET /drafts\n- \"Delete a draft?\" -> DELETE /drafts/{id}\n- \"Get draft details?\" -> GET /drafts/{id}\n- \"List all instances?\" -> GET /instances\n- \"Delete a instance?\" -> DELETE /instances/{id}\n- \"Get instance details?\" -> GET /instances/{id}\n- \"List all ips?\" -> GET /ips\n- \"List all organization?\" -> GET /organization\n- \"List all projects?\" -> GET /projects\n- \"Create a project?\" -> POST /projects\n- \"Delete a project?\" -> DELETE /projects/{id}\n- \"Get project details?\" -> GET /projects/{id}\n- \"Create a publish?\" -> POST /projects/{id}/publish\n- \"Create a redirection?\" -> POST /redirections\n- \"List all rules?\" -> GET /rules\n- \"Create a rule?\" -> POST /rules\n- \"Delete a rule?\" -> DELETE /rules/{id}\n- \"Get rule details?\" -> GET /rules/{id}\n- \"Update a rule?\" -> PUT /rules/{id}\n- \"List all statistics?\" -> GET /rules/{id}/statistics\n- \"How to authenticate?\" -> See Auth section\n\n## Response Tips\n- Check response schemas in references/api-spec.lap for field details\n- Create/update endpoints typically return the created/updated object\n\n## CLI\n\n```bash\n# Update this spec to the latest version\nnpx @lap-platform/lapsh get redirection-io -o references/api-spec.lap\n\n# Search for related APIs\nnpx @lap-platform/lapsh search redirection-io\n```\n\n## References\n- Full spec: See references/api-spec.lap for complete endpoint details, parameter tables, and response schemas\n\n> Generated from the official API spec by [LAP](https://lap.sh)\n","references/api-spec.lap":"@lap v0.3\n# Machine-readable API spec. Each @endpoint block is one API call.\n@api redirection.io\n@base https://api.redirection.io/\n@version 2.0.0\n@auth Bearer bearer | ApiKey Authorization in header\n@endpoints 24\n@hint download_for_search\n@toc domains(4), drafts(3), instances(3), ips(1), organization(1), projects(5), redirections(1), rules(6)\n\n@group domains\n@endpoint GET /domains\n@desc Retrieves the collection of the domains.\n@required {projectId: str # The id of the project.}\n@optional {searchAfterId: str # The id of the last domain returned in the previous page. Used for pagination.}\n@returns(200) ProjectDomain collection\n@errors {403: Forbidden}\n\n@endpoint POST /domains\n@desc Creates a new domain\n@required {domain: str, project: str(iri-reference) # An IRI reference to the project, of the form `/projects/{project_id}`.}\n@optional {backendAddress: str # The address of this backend, if there is one., backendAllowInvalidCertificate: bool=true, backendEnabled: bool=false, backendUseSsl: bool=true, sslAutomatic: bool=true, sslEnabled: bool=true}\n@returns(201) {backendAddress: str?, backendAllowInvalidCertificate: bool, backendEnabled: bool, backendUseSsl: bool, dnsValid: bool, domain: str, id: str, records: [map], sslAutomatic: bool, sslEnabled: bool} # ProjectDomain resource created\n@errors {400: Invalid input, 403: Forbidden, 422: An error occurred}\n\n@endpoint DELETE /domains/{id}\n@desc Permanently deletes a domain\n@required {id: str # ProjectDomain identifier}\n@returns(204) ProjectDomain resource deleted\n@errors {403: Forbidden, 404: Not found}\n\n@endpoint GET /domains/{id}\n@desc Retrieves a ProjectDomain resource.\n@required {id: str # ProjectDomain identifier}\n@returns(200) {backendAddress: str?, backendAllowInvalidCertificate: bool, backendEnabled: bool, backendUseSsl: bool, dnsValid: bool, domain: str, id: str, records: [map], sslAutomatic: bool, sslEnabled: bool} # ProjectDomain resource\n@errors {403: Forbidden, 404: Not found}\n\n@endgroup\n\n@group drafts\n@endpoint GET /drafts\n@desc Retrieves the collection of Draft rules\n@required {projectId: str # The id of the project.}\n@optional {searchAfterId: str # The id of the last draft returned in the previous page. Used for pagination., tags: [str] # The name of one or more tags. Every draft that is attached to at least one of those tags will be returned. Tags can also be passed as a comma separated list., enabled: bool # The enabled status of the rule., triggerUrl: str # The trigger source URL. This allows to filter draft rules that are triggered by a specific URL.}\n@returns(200) Draft collection\n\n@endpoint DELETE /drafts/{id}\n@desc Deletes a Draft\n@required {id: str # Draft identifier}\n@returns(204) Draft resource deleted\n@errors {403: Forbidden, 404: Not found}\n\n@endpoint GET /drafts/{id}\n@desc Retrieves a Draft resource.\n@required {id: str # Draft identifier}\n@returns(200) {id: str, rule: map{actions: [map], description: str?, enabled: bool, examples: [map], id: str, lastUsedAt: str(date-time)?, markers: [map], metadata: map, priority: int, tags: [str], trigger: map{date: [map], datetime: [map], excludeMethods: bool, excludeResponseStatusCodes: bool, ipAddress: any, methods: [str], requestHeaders: [map], responseStatusCodes: [int], sampling: int?, source: str, time: [map]}, usageCount: int, variables: [map]}, status: str} # Draft resource\n@errors {403: Forbidden, 404: Not found}\n\n@endgroup\n\n@group instances\n@endpoint GET /instances\n@desc List project instances\n@required {projectId: str # The id of the project.}\n@optional {name: str # The name of the instance., searchAfterId: str # The id of the last instance returned in the previous page. Used for pagination.}\n@returns(200) Instance collection\n@errors {403: Forbidden}\n\n@endpoint DELETE /instances/{id}\n@desc Delete an instance\n@required {id: str # Instance identifier}\n@returns(204) Instance resource deleted\n@errors {403: Forbidden, 404: Not found}\n\n@endpoint GET /instances/{id}\n@desc Retrieves a Instance resource.\n@required {id: str # Instance identifier}\n@returns(200) {agentVersion: str, agentVersionStatus: str, createdAt: str(date-time), id: str, logging: bool?, logsLastFlushedAt: str(date-time)?, misconfigured: bool, name: str, rulesCount: int, rulesLastUpdatedAt: str(date-time)?} # Instance resource\n@errors {403: Forbidden, 404: Not found}\n\n@endgroup\n\n@group ips\n@endpoint GET /ips\n@desc Retrieves the collection of Ip resources.\n@returns(200) Ip collection\n\n@endgroup\n\n@group organization\n@endpoint GET /organization\n@desc Retrieve the details of your organization\n@returns(200) {id: str, name: str, projects: [map], slug: str} # Organization resource\n\n@endgroup\n\n@group projects\n@endpoint GET /projects\n@desc Retrieves the collection of Project resources.\n@returns(200) Project collection\n\n@endpoint POST /projects\n@desc Creates a new project\n@required {name: str}\n@optional {metadata: map}\n@returns(201) {id: str, metadata: map, name: str, plan: str, slug: str} # Project resource created\n@errors {400: Invalid input, 422: An error occurred}\n\n@endpoint DELETE /projects/{id}\n@desc Permanently deletes a project\n@required {id: str # Project identifier}\n@returns(204) Project resource deleted\n@errors {403: Forbidden, 404: Not found}\n\n@endpoint GET /projects/{id}\n@desc Retrieves a Project resource.\n@required {id: str # Project identifier}\n@returns(200) {id: str, metadata: map, name: str, plan: str, slug: str} # Project resource\n@errors {403: Forbidden, 404: Not found}\n\n@endpoint POST /projects/{id}/publish\n@desc Publishes the collection of Draft resources\n@required {id: str # The id of the project.}\n@returns(204) Draft resources collection published\n@errors {400: Invalid input, 403: Forbidden}\n\n@endgroup\n\n@group redirections\n@endpoint POST /redirections\n@desc Creates a new Redirection\n@required {project: str(iri-reference) # An IRI reference to the project, of the form `/projects/{project_id}`., source: str # The URL to be redirected. This URL must start with `/`, `://`, `http://` or `https://`, statusCode: int(301/302/307/308) # The status code to use for this redirection., target: str # The redirection target URL. It must can be a relative URL (starting with `/`) or an absolute one (starting with `://`, `http://` or `https://`).}\n@optional {description: str # This description field is used to describe the rule and share knowledge with other users, enabled: bool=true # Set to \"false\" to disable this rule. Even once published, this rule will not be used by your website, priority: int=0 # A rule with higher priority takes precedence over lower priorities, which means that the actions defined in the higher priority rule will override the similar actions defined in a lower priority one, tags: [str] # Tags are useful to filter rules and retrieve them easily}\n@returns(201) {id: str, rule: map{actions: [map], description: str?, enabled: bool, examples: [map], id: str, lastUsedAt: str(date-time)?, markers: [map], metadata: map, priority: int, tags: [str], trigger: map{date: [map], datetime: [map], excludeMethods: bool, excludeResponseStatusCodes: bool, ipAddress: any, methods: [str], requestHeaders: [map], responseStatusCodes: [int], sampling: int?, source: str, time: [map]}, usageCount: int, variables: [map]}, status: str} # Draft rule resource created (with the status `add`)\n@errors {400: Invalid input, 403: Forbidden, 422: An error occurred}\n\n@endgroup\n\n@group rules\n@endpoint GET /rules\n@desc Retrieves the collection of currently published Rule resources.\n@required {projectId: str # The id of the project.}\n@optional {searchAfterId: str # The id of the last rule returned in the previous page. Used for pagination., tags: [str] # The name of one or more tags. Every Rule that is attached to at least one of those tags will be returned. Tags can also be passed as a comma separated list., enabled: bool # The enabled status of the rule., triggerUrl: str # The trigger source URL. This allows to filter rules that are triggered by a specific URL.}\n@returns(200) Rule collection\n@errors {403: Forbidden}\n\n@endpoint POST /rules\n@desc Creates a new draft Rule\n@optional {actions: [map{}] # Each `Action` must be an object with a `type` property, and some other properties according to its type:  * `configuration`:     * `logEnabled` (bool, required)     * `reset` (bool, required) * `convertToMarkdown`:     * no additional property * `customHtml`:     * `value` (string, required)     * `cssSelector` (string, required)     * `action` (string, required). One of `append_child`, `prepend_child`, `replace`     * `location` (string, deprecated). One of `headStart`, `headEnd`, `bodyStart`, `bodyEnd` * `customBody`:     * `value` (string, required)     * `contentType` (string, required). Content-type header to use for the response. * `customStatus`:     * `statusCode` (int, required). A valid status code between 200 and 511 ([see the official documentation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses) for more information) * `header`:     * `name` (string, required)     * `value` (string, required)     * `mode` (string, required). One of `override`, `default`, `replace`, `append`, `add`     * `override` (bool, deprecated). Use the `mode` property instead. * `meta`:     * `type` (string, required). One of `title`, `description`, `keywords`, `author`, `og:title`, `og:description`, `og:type`, `og:image`, `og:url`, `og:locale`, `og:site_name`, 'canonical`     * `value` (string, required)     * `replace` (bool, required) * `redirection`:     * `location` (string, required)     * `statusCode` (int, required). One of `301`, `302`, `307`, `308` * `robotsTxt`:     * `content` (string, required) * `sitemap`:     * `name` (string)     * `content` (string, required) * `structuredData`:     * `value` (string, required), description: str # This description field is used to describe the rule and share knowledge with other users, enabled: bool=true # Set to `false` to disable this rule, examples: [map{datetime: str(date-time), headers: [map], ipAddress: str, method: str, mustMatch!: bool, responseBody: str, responseHeaders: [map], responseStatusCode: int, url!: str}] # Examples are useful to test your rule. They are not used in production., markers: [map{}] # Each `Marker` must be an object with a `type` property, and some other properties according to its type: * `anything`: No options * `custom`:     * `regex` (string, required) * `enum`     * `values` (array of string, required) * `date`: No options * `datetime`: No options * `integer`:     * `minimum` (int, required)     * `maximum` (int, required) * `string`:     * `allowLowercaseAlphabet` (bool)     * `allowUppercaseAlphabet` (bool)     * `allowDigits` (bool)     * `allowPercentEncodedChars` (bool)     * `specificCharacters` (array of string of length 1)     * `startingWith` (string)     * `endingWith` (string)     * `containing` (string) * `uuid`: No options, metadata: map, priority: int=0 # A rule with higher priority takes precedence over lower priorities, which means that the actions defined in the higher priority rule will override the similar actions defined in a lower priority one, project: str(iri-reference) # An IRI reference to the project, of the form `/projects/{project_id}`., tags: [str] # Tags are useful to filter rules and retrieve them easily, trigger: map{date: [map], datetime: [map], excludeMethods: bool, excludeResponseStatusCodes: bool, ipAddress: any, methods: [str], requestHeaders: [map], responseStatusCodes: [int], sampling: int, source!: str, time: [map]}, variables: [map{}]}\n@returns(201) {id: str, rule: map{actions: [map], description: str?, enabled: bool, examples: [map], id: str, lastUsedAt: str(date-time)?, markers: [map], metadata: map, priority: int, tags: [str], trigger: map{date: [map], datetime: [map], excludeMethods: bool, excludeResponseStatusCodes: bool, ipAddress: any, methods: [str], requestHeaders: [map], responseStatusCodes: [int], sampling: int?, source: str, time: [map]}, usageCount: int, variables: [map]}, status: str} # Draft rule resource created (with the status `add`)\n@errors {400: Invalid input, 403: Forbidden, 422: An error occurred}\n\n@endpoint DELETE /rules/{id}\n@desc Deletes a Rule\n@required {id: str # Rule identifier}\n@returns(200) {id: str, rule: map{actions: [map], description: str?, enabled: bool, examples: [map], id: str, lastUsedAt: str(date-time)?, markers: [map], metadata: map, priority: int, tags: [str], trigger: map{date: [map], datetime: [map], excludeMethods: bool, excludeResponseStatusCodes: bool, ipAddress: any, methods: [str], requestHeaders: [map], responseStatusCodes: [int], sampling: int?, source: str, time: [map]}, usageCount: int, variables: [map]}, status: str} # Draft rule resource updated (with the status `delete`)\n@errors {403: Forbidden, 404: Not found}\n\n@endpoint GET /rules/{id}\n@desc Retrieves a Rule resource\n@required {id: str # Rule identifier}\n@returns(200) {actions: [map], description: str?, enabled: bool, examples: [map], id: str, lastUsedAt: str(date-time)?, markers: [map], metadata: map, priority: int, tags: [str], trigger: map{date: [map], datetime: [map], excludeMethods: bool, excludeResponseStatusCodes: bool, ipAddress: any, methods: [str], requestHeaders: [map], responseStatusCodes: [int], sampling: int?, source: str, time: [map]}, usageCount: int, variables: [map]} # Rule resource\n@errors {403: Forbidden, 404: Not found}\n\n@endpoint PUT /rules/{id}\n@desc Updates an existing Rule\n@required {id: str # Rule identifier}\n@optional {actions: [map{}] # Each `Action` must be an object with a `type` property, and some other properties according to its type:  * `configuration`:     * `logEnabled` (bool, required)     * `reset` (bool, required) * `convertToMarkdown`:     * no additional property * `customHtml`:     * `value` (string, required)     * `cssSelector` (string, required)     * `action` (string, required). One of `append_child`, `prepend_child`, `replace`     * `location` (string, deprecated). One of `headStart`, `headEnd`, `bodyStart`, `bodyEnd` * `customBody`:     * `value` (string, required)     * `contentType` (string, required). Content-type header to use for the response. * `customStatus`:     * `statusCode` (int, required). A valid status code between 200 and 511 ([see the official documentation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses) for more information) * `header`:     * `name` (string, required)     * `value` (string, required)     * `mode` (string, required). One of `override`, `default`, `replace`, `append`, `add`     * `override` (bool, deprecated). Use the `mode` property instead. * `meta`:     * `type` (string, required). One of `title`, `description`, `keywords`, `author`, `og:title`, `og:description`, `og:type`, `og:image`, `og:url`, `og:locale`, `og:site_name`, 'canonical`     * `value` (string, required)     * `replace` (bool, required) * `redirection`:     * `location` (string, required)     * `statusCode` (int, required). One of `301`, `302`, `307`, `308` * `robotsTxt`:     * `content` (string, required) * `sitemap`:     * `name` (string)     * `content` (string, required) * `structuredData`:     * `value` (string, required), description: str # This description field is used to describe the rule and share knowledge with other users, enabled: bool=true # Set to `false` to disable this rule, examples: [map{datetime: str(date-time), headers: [map], ipAddress: str, method: str, mustMatch!: bool, responseBody: str, responseHeaders: [map], responseStatusCode: int, url!: str}] # Examples are useful to test your rule. They are not used in production., markers: [map{}] # Each `Marker` must be an object with a `type` property, and some other properties according to its type: * `anything`: No options * `custom`:     * `regex` (string, required) * `enum`     * `values` (array of string, required) * `date`: No options * `datetime`: No options * `integer`:     * `minimum` (int, required)     * `maximum` (int, required) * `string`:     * `allowLowercaseAlphabet` (bool)     * `allowUppercaseAlphabet` (bool)     * `allowDigits` (bool)     * `allowPercentEncodedChars` (bool)     * `specificCharacters` (array of string of length 1)     * `startingWith` (string)     * `endingWith` (string)     * `containing` (string) * `uuid`: No options, metadata: map, priority: int=0 # A rule with higher priority takes precedence over lower priorities, which means that the actions defined in the higher priority rule will override the similar actions defined in a lower priority one, project: str(iri-reference) # An IRI reference to the project, of the form `/projects/{project_id}`., tags: [str] # Tags are useful to filter rules and retrieve them easily, trigger: map{date: [map], datetime: [map], excludeMethods: bool, excludeResponseStatusCodes: bool, ipAddress: any, methods: [str], requestHeaders: [map], responseStatusCodes: [int], sampling: int, source!: str, time: [map]}, variables: [map{}]}\n@returns(200) {id: str, rule: map{actions: [map], description: str?, enabled: bool, examples: [map], id: str, lastUsedAt: str(date-time)?, markers: [map], metadata: map, priority: int, tags: [str], trigger: map{date: [map], datetime: [map], excludeMethods: bool, excludeResponseStatusCodes: bool, ipAddress: any, methods: [str], requestHeaders: [map], responseStatusCodes: [int], sampling: int?, source: str, time: [map]}, usageCount: int, variables: [map]}, status: str} # Draft rule resource updated (with the status `update`)\n@errors {400: Invalid input, 403: Forbidden, 404: Not found, 422: An error occurred}\n\n@endpoint GET /rules/{id}/statistics\n@desc Retrieves the usage statistics of a rule.\n@required {id: str # The id of the rule.}\n@optional {start: str # The start date of the statistic usage in RFC 3339 format (without milliseconds). If not provided, the statistics from the rule creation date will be used., end: str # The end date of the statistic usage in RFC 3339 format (without milliseconds).}\n@returns(200) RuleStatistic collection\n@errors {403: Forbidden}\n\n@endgroup\n\n@end\n"}}