ByteChef LogoByteChef

Figma

Figma is a cloud-based design and prototyping tool that enables teams to collaborate in real-time on user interface and user experience projects.

Categories: Productivity and Collaboration

Type: figma/v1


Connections

Version: 1

OAuth2 Authorization Code

Properties

NameLabelTypeDescriptionRequired
clientIdClient IdSTRINGtrue
clientSecretClient SecretSTRINGtrue

Connection Setup

Create a Figma OAuth App

  1. Go to https://www.figma.com/developers/apps (or click “My Apps” in the top toolbar).
  2. Click Create a new app (top-right).
  3. Enter a name for your OAuth app and select a Team/Organization. The app must be associated with a team or organization.
  4. Click Create.
  5. Copy the Client ID and Client Secret and store them securely.
    • Figma shows the Client Secret only once. You’ll need it for token exchange and refreshing access tokens.

Configure OAuth Scopes

On the OAuth scopes page, select the scopes your app needs. For the ByteChef Figma connector, enable:

  • file_comments:read
  • file_comments:write
  • webhooks:write

Set the Redirect URI

Add the ByteChef OAuth2 callback URL as a Redirect URI in your Figma app:

  • Example cloud URL: https://app.bytechef.io/callback
  • Example local URL: http://127.0.0.1:5173/callback

If you run ByteChef with a custom domain, the pattern is: <YOUR_PUBLIC_URL>/callback.


Actions

Get Comments

Name: getComments

Gets a list of comments left on the file.

Properties

NameLabelTypeDescriptionRequired
fileKeyFile KeySTRINGFile to get comments from. Figma file key copy from Figma file URL.true

Example JSON Structure

{
  "label" : "Get Comments",
  "name" : "getComments",
  "parameters" : {
    "fileKey" : ""
  },
  "type" : "figma/v1/getComments"
}

Output

Type: OBJECT

Properties

NameTypeDescription
commentsARRAY
Items [{STRING(id), STRING(file_key), STRING(parent_id), {STRING(id), STRING(handle), STRING(img_url), STRING(email)}(user)}]
List of comments.

Output Example

{
  "comments" : [ {
    "id" : "",
    "file_key" : "",
    "parent_id" : "",
    "user" : {
      "id" : "",
      "handle" : "",
      "img_url" : "",
      "email" : ""
    }
  } ]
}

Find File Key

To find a Figma file key, copy the alphanumeric string located between /file/ (or /design/, /proto/, etc.) and the file name in the browser URL. For example, in https://www.figma.com/file/ABC123456/File-Name, the file key is ABC123456. You can also right-click a file in the desktop app and select Copy link to extract it.

Post Comment

Name: postComment

Posts a new comment on the file.

Properties

NameLabelTypeDescriptionRequired
fileKeyFile KeySTRINGFile to add comments in. Figma file key copy from Figma file URL.true
messageCommentSTRINGComment to post on the file.true

Example JSON Structure

{
  "label" : "Post Comment",
  "name" : "postComment",
  "parameters" : {
    "fileKey" : "",
    "message" : ""
  },
  "type" : "figma/v1/postComment"
}

Output

Type: OBJECT

Properties

NameTypeDescription
idSTRINGID of the comment.
file_keySTRINGFile key of the file the comment is on.
parent_idSTRINGID of comment this comment is a reply to.
messageSTRINGMessage of the comment.

Output Example

{
  "id" : "",
  "file_key" : "",
  "parent_id" : "",
  "message" : ""
}

Find File Key

To find a Figma file key, copy the alphanumeric string located between /file/ (or /design/, /proto/, etc.) and the file name in the browser URL. For example, in https://www.figma.com/file/ABC123456/File-Name, the file key is ABC123456. You can also right-click a file in the desktop app and select Copy link to extract it.

Triggers

New Comment

Name: newComment

Triggers when new comment is posted.

Type: DYNAMIC_WEBHOOK

Properties

NameLabelTypeDescriptionRequired
team_idTeam IDSTRINGThe ID of the team.true

Output

Type: OBJECT

Properties

NameTypeDescription
file_nameSTRINGThe name of the file that was updated.
created_atSTRINGThe UTC ISO 8601 time at which the comment was left.
comment_idSTRINGID of the comment.
triggered_byOBJECT
Properties {STRING(id), STRING(handle), STRING(email), STRING(img_url)}
The user that made the comment and triggered this event.
file_keySTRINGThe key of the file that was updated.
retriesINTEGERNumber of times the event has been retried.
event_typeSTRINGType of the event.
webhook_idSTRINGThe id of the webhook that caused the callback.
parent_idSTRINGIf present, the id of the comment to which this is the reply.
resolved_atSTRINGIf set, the UTC ISO 8601 time the comment was resolved.
mentionsARRAY
Items [{STRING(id), STRING(handle), STRING(email), STRING(img_url)}]
Users that were mentioned in the comment.
commentARRAY
Items [{STRING(text), STRING(mention)}]
Contents of the comment itself.
order_idSTRINGOnly set for top level comments. The number displayed with the comment in the UI.
passcodeSTRINGThe passcode specified when the webhook was created, should match what was initially provided.
timestampSTRINGUTC ISO 8601 timestamp of when the event was triggered.

JSON Example

{
  "label" : "New Comment",
  "name" : "newComment",
  "parameters" : {
    "team_id" : ""
  },
  "type" : "figma/v1/newComment"
}

Find Team ID

To find your Figma Team ID, open the Figma web browser app, click on your team name in the left-hand sidebar, and copy the long numerical string located after /team/ in the URL bar (e.g., figma.com/team/123456789/team-name).

What to do if your action is not listed here?

If this component doesn't have the action you need, you can use Custom Action to create your own. Custom Actions empower you to define HTTP requests tailored to your specific requirements, allowing for greater flexibility in integrating with external services or APIs.

To create a Custom Action, simply specify the desired HTTP method, path, and any necessary parameters. This way, you can extend the functionality of your component beyond the predefined actions, ensuring that you can meet all your integration needs effectively.

How is this guide?

Last updated on

On this page