# Register an existing function repository
We recommend to always create a new Function from one of the templates provided by Speckle. Even if you wish to create a Function in a different language, you can use any template and modify it later.
However, if you do already have a GitHub repository for a Function, you can register that with Automate.
# Registering an existing Function
- Click your profile icon in the top right corner of the Automate web application and select
API and Dev Info
. - Copy the
API token
and save securely. This token can be used to authenticate with the Speckle Automate API and undertake actions on your behalf. It should be treated as securely as a password. - Follow the link to the
Interactive API Docs
. - Click the
Authorize
button in the top right corner of the page and enter yourAPI token
you saved earlier. - In the
Functions
section, expand thePOST /api/v1/functions
endpoint.- If you cannot see this Endpoint, this is because of a known limitation. In a terminal please run
curl -v --request POST https://automate.speckle.dev/api/v1/functions
, then return to the Interactive API Docs and refresh the page. We hope to improve this experience soon.
- If you cannot see this Endpoint, this is because of a known limitation. In a terminal please run
- Click the
Try it out
button. - Amend the details in the
Request Body
section to match your Function. A description of each property is provided in theCreateFunctionInput
section towards the bottom of the page. - Click the
Execute
button. - If successful, you will receive a
201
response code and aFunction
object will be returned in theResponse Body
section. This object will contain theid
of your Function and the Function token. Please save both the ID and the Function token. Again, please treat the Function token securely like a password. - You can now open your GitHub repository and create secrets for your GitHub Action. Please refer to GitHub's instructions for creating secrets (opens new window).
- The secrets should be named
SPECKLE_FUNCTION_ID
andSPECKLE_FUNCTION_TOKEN
, and the values should be the ID and Function token you saved earlier. - Please trigger a new run of your GitHub Action, or create a new GitHub release. This will create a new version of your Function in Automate.