# 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 tokenand 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
Authorizebutton in the top right corner of the page and enter yourAPI tokenyou saved earlier. - In the
Functionssection, expand thePOST /api/v1/functionsendpoint.- 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 outbutton. - Amend the details in the
Request Bodysection to match your Function. A description of each property is provided in theCreateFunctionInputsection towards the bottom of the page. - Click the
Executebutton. - If successful, you will receive a
201response code and aFunctionobject will be returned in theResponse Bodysection. This object will contain theidof 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_IDandSPECKLE_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.