cold-scientist-93808
08/08/2024, 11:14 AMchilly-king-10285
08/08/2024, 11:14 AMchilly-king-10285
08/08/2024, 11:15 AM/self-service/registration
endpoint with a POST
request, you can include traits in the request body. The response will include the user's traits as part of the user's identity. Here is an example of how to include traits in the registration request: bash curl -s -X POST -H "Content-Type: application/json" \ -d '{"traits.email": "[[email protected]]", "password": "__MY__PASSWORD__", "method": "password"}' \ "$actionUrl" | jq
And the response will look something like this: json { "session_token": "UA8rB8ydXyMyiIWcX8VeSWjUB7Z21YF1", "session": { "identity": { "traits": { "email": "[[email protected]]" }, } } }
In this example, traits.email
is a trait that is included in the registration request and returned in the response. However, this is not fetching a default value, but rather setting a value during registration. For more information, you can refer to the [Ory Kratos documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-registration#registering-new-user-information).