The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December. Read our blog post for more info about this change.
Found this content helpful? Log in or sign up to leave a like!
What is the best way to check if a user is authorized to create a conversation via the Canvas API for a specific recipient user?
I am seeing odd behavior using this API endpoint:
https://canvas.instructure.com/doc/api/conversations.html#method.conversations.create
The sender is the recipient's teacher. I am getting this response back from the HTTP POST request:
{ "attribute": "recipients", "message": "invalid" }
I looked over the source code, and it seems to indicate that the sender does not have permission to send messages to the recipient.
Source code references:
Hello @SpencerWilliams
Thank you for contacting the Instructure Community. Yes, Canvas does have an API call for this already. "Find valid recipients (users, courses and groups) that the current user can send messages to. The /api/v1/search/recipients path is the preferred endpoint, /api/v1/conversations/find_recipients is deprecated." Your other option is to masquerade as the user or go to the course and check as all conversations are tied to course enrollments.
Here is the Canvas guide:
https://canvas.instructure.com/doc/api/search.html#method.search.recipients
Hi Greydon,
From the API documentation you shared, it seems this only allows to check for the "current user". How would I be able to tell if userA (user_id: 1) can start a conversation with userB (user_id: 2)?
This is what I got so far:
curl $URL -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $TEST_TOKEN" -d '{"user_id": 2}'
How can I specify userA (user_id: 1) as the "current user"?
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in