# Signed URLs in Go

> Generate a signed URL with the Go SDK. The URL renders a template image when someone opens it.

Canonical: https://bannerify.co/docs/sdk/go/apis/signed-url

`GenerateImageSignedURL` builds a link that renders an image when someone opens it. It makes no network request: the SDK signs the URL on your server with your API key.

## Request

It takes a template id and a `*CreateImageOptions`. A `nil` value uses the defaults.

<ParamField body="templateID" type="string" required>
  The template id, for example `tpl_xxx`.
</ParamField>

<ParamField body="Modifications" type="[]Modification">
  The values to put into the template's layers. They travel in the URL, so keep them short. [Modifications](https://bannerify.co/docs/essentials/modifications) lists the fields each layer accepts.
</ParamField>

<ParamField body="Format" type="string" default="png">
  The image format: `png`, `jpeg`, or `webp`. The method returns an error for any other value.
</ParamField>

The Go SDK has no `nocache` option. [Signed URLs](https://bannerify.co/docs/essentials/signed-urls) shows how to skip the cache when you build the URL yourself.

```go
signedURL, err := client.GenerateImageSignedURL("tpl_xxx", &bannerify.CreateImageOptions{
	Modifications: []bannerify.Modification{
		{Name: "headline", Text: ptr("Hello, Ada")},
	},
	Format: "jpeg",
})
if err != nil {
	return err
}
```

## Response

The method returns the URL as a string:

```text
https://api.bannerify.co/v1/templates/signedurl?apiKeyHashed=2f5a...&format=jpeg&modifications=%5B...%5D&sign=ce2d...&templateId=tpl_xxx
```

`apiKeyHashed` tells Bannerify which key signed the URL. `sign` is an HMAC-SHA256 of the other parameters, keyed with your API key. Nobody can change the template or the modifications in a signed URL without breaking the signature, so you can put the URL in a page, an email, or a meta tag.

```go
tag := fmt.Sprintf(`<img src="%s" alt="Welcome banner">`, html.EscapeString(signedURL))
```

Bannerify caches the rendered image for up to 7 days. [Signed URLs](https://bannerify.co/docs/essentials/signed-urls) explains caching, quota, and limits.

## Related

- [Previous: Render videos in Go](https://bannerify.co/docs/sdk/go/apis/render-video)
- [Next: Python SDK](https://bannerify.co/docs/sdk/python/overview)
- [Documentation index](https://bannerify.co/docs/llms.txt)
