Overview
There are three ways to interact with the Figma API through our platform:Figma API Quirks
Every Figma REST API request requires ateam ID
. This is a unique identifier for your Figma team. Webhooks are created at the team level, so you/your users will need to provide this value when creating a webhook. We provide a helper function to retrieve the team ID
for you. See below.
Creating a Webhook for a User
TheSDK
is strongly typed and uses Classes
in the background to provide the easiest experience possible. Here’s how to create a webhook:
Step 1:
Team ID Retrieval: Figma’sREST API
doesn’t support retrieving the team ID
programmatically. You will need this value to interact with the API. The team ID
can be found in the URL of your Figma team. Use our hook to redirect the user to obtain the teamID value.
Step 2:
Use the SDK to create a new webook for a user. If you don’t provide an external user, the webhook will be created for the user who the access token belongs to. Example:create-figma.ts
Updating a Webhook for a User
If you don’t want to create a new webhook, you can update an existing one. This is useful if you want to change thecallbackUrl
or eventType
. The resulting webhook will be under the same project and endpointID so you don’t need to worry about updating things in your database/storage.
Example Payloads
With each provider we have example payloads so you can test the webhook events. This can be useful for debugging and testing your application. To import, each payload example starts with the provider name and then the event name. For example,figmaFileCommentEventExamplePayload
. Use intelligent auto-complete in your IDE to find the payload you need.
Here’s an example of the Figma File Comment Example Payload
(you can import as figmaFileCommentEventExamplePayload
):
Types
We also provide types for all supported event payloads. This can be helpful when you are consuming webhooks on your endpoint. Instead of the payload body being anany
type, now you can do something like this: