How to use orgid in multi-tenant Saas application
# support
s
So while creating an asistant, I should be sending the orgid of the user logined, to create assistant in their org, but I can't see orgid in the request of the api: https://docs.vapi.ai/api-reference/assistants/create Let me know how things are working, show me one case study of how muti-tenant app would work with vapi apis
@User
@User Help please
r
hi @Sarmed , the
orgId
should be returned in the response from the initial Create Assistant request, can you share the response you get from the POST request to /assistant? You should be able to see the orgId in the response. In the initial request, the only required field is Authorization header, you may need to switch between various Authorization headers if you are planning to create assistants for multiple orgs. Please let me know if that helps clarify any misunderstandings, thanks!
s
How will I create Authorization headers for every other org? Is there any API for that?
@ram_vapi
r
Hi @Sarmed are you able to use the JWT Authentication flow and pass an orgId as part of the payload to retrieve token via generateJWT function? https://docs.vapi.ai/customization/jwt-authentication#generating-a-jwt-token
s
Ohh okay, I got it noww
Thanks a lot
3 Views