How can I generate invite links to Trello board

Hi, Im building an chat-bot app, and I use your Trello API, to create organizations and boards, I want to invite people to these boards sending them invite links, but I couldnt find a way to generate one.
I only found API docs about inviting people with email, but it isnt really what I need

I also fumbled around Trello web site and found out that this API hand exists, though there is nothing about it in docs:{board_id}/invitationSecret

If we explore request, that is sent from Trello web-site, we can see that there are 2 things in request’s payload
“token” - as I supose it is user_id/session_id, if we make requests from outside this is only an API token
“type”: “normal:” -I didn’t really understand what it is.

So if Im using a REST API to send this request I configure my payload as

query = {
    'key': my_trello_api_key,
    'token': my_trello_api_token,
    'type': 'normal'    

but it always returns 401 ‘unauthorized permission requested’

Also found this topic, but as I suppose Adriana is missing the fact that server is blocking request to this url (or am I 'm being stupid and missing something obvious :thinking: :thinking: :thinking:)

hey, adriana here.

i don’t see a request payload like that in my network when i open the share modal. the web client should make a request to, as you’ve identified. however, there is no key and token in the parameters of that request.

i believe that you need the cookie from your browser to generate the invitation secret, and it’s set in the request headers, not as a parameter. that request should return a payload like {secret: '', type: 'normal}. that secret is referenced in the previous post, and can be sent to to redirect to the ‘shared board’ page.

so, in sum:

  • if you have access to your cookie, you make a request to to generate a secret, using the cookie in the headers and not as a request parameter/body
  • use the returned secret to send a generated invite link like, which will redirect to the “[user] has shared this board” page

let me know if that works for your situation.

Thats kinda worked for GET request, I just copy-pasted all ‘cookie’ header from direct request to …/invitationSecret from browser and GET request to API returned a secret, but it still doesnt works with POST, witch as I see in browser, creates secrets

When i click Create link it sends POST request to invitationSecret, to create one and then GET to actually… get it and push it into copy link thing

so if I want to send invites automatically, I need to do both POST & GET
Actually It is doable with only POST as it returns the same Json as GET, so I just need to make 1 POST request and get secret from it’s response