User Profiles
As the name suggests, profiles are a core part of Castr GÜRŲ — the very reason Castr GÜRŲ exists is so you can have secure conversations with your profiles. On this page, we'll dive into the different profile endpoints you can use to manage profiles programmatically. We'll look at how to query, create, update, and delete profiles.
The profile model
The profile model contains all the information about your profiles, such as their username, avatar, and phone number. It also contains a reference to the conversation between you and the profile and information about when they were last active on Castr GÜRŲ.
Properties
- Name
id
- Type
- string
- Description
Unique identifier for the profile.
- Name
username
- Type
- string
- Description
The username for the profile.
- Name
phone_number
- Type
- string
- Description
The phone number for the profile.
- Name
avatar_url
- Type
- string
- Description
The avatar image URL for the profile.
- Name
display_name
- Type
- string
- Description
The profile display name in the profile list. By default, this is just the username.
- Name
conversation_id
- Type
- string
- Description
Unique identifier for the conversation associated with the profile.
- Name
last_active_at
- Type
- timestamp
- Description
Timestamp of when the profile was last active on the platform.
- Name
created_at
- Type
- timestamp
- Description
Timestamp of when the profile was created.
List all profiles
This endpoint allows you to retrieve a paginated list of all your profiles. By default, a maximum of ten profiles are shown per page.
Optional attributes
- Name
limit
- Type
- integer
- Description
Limit the number of profiles returned.
Request
curl -G https://castr.guru/v1/profiles \
-H "Authorization: Bearer {token}" \
-d active=true \
-d limit=10
Response
{
"has_more": false,
"data": [
{
"id": "WAz8eIbvDR60rouK",
"username": "FrankMcCallister",
"phone_number": "1-800-759-3000",
"avatar_url": "https://assets.castr.guru/avatars/frank.jpg",
"display_name": null,
"conversation_id": "xgQQXg3hrtjh7AvZ",
"last_active_at": 705103200,
"created_at": 692233200
},
{
"id": "hSIhXBhNe8X1d8Et"
// ...
}
]
}
Create a profile
This endpoint allows you to add a new profile to your profile list in Castr GÜRŲ. To add a profile, you must provide their Castr GÜRŲ username and phone number.
Required attributes
- Name
username
- Type
- string
- Description
The username for the profile.
- Name
phone_number
- Type
- string
- Description
The phone number for the profile.
Optional attributes
- Name
avatar_url
- Type
- string
- Description
The avatar image URL for the profile.
- Name
display_name
- Type
- string
- Description
The profile display name in the profile list. By default, this is just the username.
Request
curl https://castr.guru/v1/profiles \
-H "Authorization: Bearer {token}" \
-d username="FrankMcCallister" \
-d phone_number="1-800-759-3000" \
-d avatar_url="https://assets.castr.guru/avatars/frank.jpg"
Response
{
"id": "WAz8eIbvDR60rouK",
"username": "FrankMcCallister",
"phone_number": "1-800-759-3000",
"avatar_url": "https://assets.castr.guru/avatars/frank.jpg",
"display_name": null,
"conversation_id": "xgQQXg3hrtjh7AvZ",
"last_active_at": null,
"created_at": 692233200
}
Retrieve a profile
This endpoint allows you to retrieve a profile by providing their Castr GÜRŲ id. Refer to the list at the top of this page to see which properties are included with profile objects.
Request
curl https://castr.guru/v1/profiles/WAz8eIbvDR60rouK \
-H "Authorization: Bearer {token}"
Response
{
"id": "WAz8eIbvDR60rouK",
"username": "FrankMcCallister",
"phone_number": "1-800-759-3000",
"avatar_url": "https://assets.castr.guru/avatars/frank.jpg",
"display_name": null,
"conversation_id": "xgQQXg3hrtjh7AvZ",
"last_active_at": 705103200,
"created_at": 692233200
}
Update a profile
This endpoint allows you to perform an update on a profile. Currently, the only attribute that can be updated on profiles is the display_name
attribute which controls how a profile appears in your profile list in Castr GÜRŲ.
Optional attributes
- Name
display_name
- Type
- string
- Description
The profile display name in the profile list. By default, this is just the username.
Request
curl -X PUT https://castr.guru/v1/profiles/WAz8eIbvDR60rouK \
-H "Authorization: Bearer {token}" \
-d display_name="UncleFrank"
Response
{
"id": "WAz8eIbvDR60rouK",
"username": "FrankMcCallister",
"phone_number": "1-800-759-3000",
"avatar_url": "https://assets.castr.guru/avatars/frank.jpg",
"display_name": "UncleFrank",
"conversation_id": "xgQQXg3hrtjh7AvZ",
"last_active_at": 705103200,
"created_at": 692233200
}
Delete a profile
This endpoint allows you to delete profiles from your profile list in Castr GÜRŲ. Note: This will also delete your conversation with the given profile.
Request
curl -X DELETE https://castr.guru/v1/profiles/WAz8eIbvDR60rouK \
-H "Authorization: Bearer {token}"