<@U04UQ68083H> I want to initiate the type:api for...
# ory-copilot
g
@chilly-king-10285 I want to initiate the type:api for the verifying the code in recovery flow
c
A message from kapa.ai
To initiate the recovery flow with type "api", you can use the
submit-recovery-native.json
as a reference. This JSON object is used to submit the recovery flow. Here is the structure of the JSON object:
Copy code
json {    "id": "733910c2-a366-424b-9c8b-c688d13f4d18",    "type": "api",    "expires_at": "2023-02-08T17:20:00.994168Z",    "issued_at": "2023-02-08T16:50:00.994168Z",    "request_url": "https://{project.slug}.<http://projects.oryapis.com/self-service/recovery/api|projects.oryapis.com/self-service/recovery/api>",    "active": "code",    "ui": {    "action": "https://{project.slug}.<http://projects.oryapis.com/self-service/recovery?flow=733910c2-a366-424b-9c8b-c688d13f4d18|projects.oryapis.com/self-service/recovery?flow=733910c2-a366-424b-9c8b-c688d13f4d18>",    "method": "POST",    "nodes": [    {    "type": "input",    "group": "default",    "attributes": {    "name": "csrf_token",    "type": "hidden",    "value": "",    "required": true,    "disabled": false,    "node_type": "input"    },    "messages": [],    "meta": {}    },    {    "type": "input",    "group": "code",    "attributes": {    "name": "code",    "type": "text",    "required": true,    "disabled": false,    "node_type": "input"    },    "messages": [],    "meta": {    "label": {    "id": 1070006,    "text": "Verify code",    "type": "info"    }    }    },    {    "type": "input",    "group": "code",    "attributes": {    "name": "method",    "type": "hidden",    "value": "code",    "disabled": false,    "node_type": "input"    },    "messages": [],    "meta": {}    },    {    "type": "input",    "group": "code",    "attributes": {    "name": "method",    "type": "submit",    "value": "code",    "disabled": false,    "node_type": "input"    },    "messages": [],    "meta": {    "label": {    "id": 1070005,    "text": "Submit",    "type": "info"    }    }    },    {    "type": "input",    "group": "code",    "attributes": {    "name": "email",    "type": "submit",    "value": "[[email protected]](<https://www.ory.sh/cdn-cgi/l/email-protection>)",    "disabled": false,    "node_type": "input"    },    "messages": [],    "meta": {    "label": {    "id": 1070007,    "text": "Resend code",    "type": "info"    }    }    }    ],    "messages": [    {    "id": 1060003, }
This JSON object includes the recovery flow ID, type, expiration and issue timestamps, request URL, active method, and UI details. The UI details include the action URL, method, and nodes. Each node represents an input field in the recovery form. The "code"
g
@chilly-king-10285 complete the answer above
c
A message from kapa.ai
The "code" node is the one that is used for the recovery code verification. It has the following attributes: - "name": "code" - "type": "text" - "required": true - "disabled": false - "node_type": "input" This means that the recovery code is a required text input field. To initiate the recovery flow, you would need to make a POST request to the "action" URL specified in the "ui" object, with the recovery code and other required fields included in the request body. Please note that the actual values for the "id", "expires_at", "issued_at", and "request_url" fields in the JSON object would be provided by the Ory Kratos API when you initiate the recovery flow. For more details, you can refer to the [Ory Kratos API documentation](https://www.ory.sh/docs/kratos/reference/api).
g
@chilly-king-10285 give me the curl request example of the above
c
A message from kapa.ai
I'm sorry, but the provided extracts do not contain a specific curl request example for initiating the recovery flow with type "api". However, you can refer to the [Ory Kratos API documentation](https://www.ory.sh/docs/kratos/reference/api) for more details and examples.