Zammad exposes a REST API over HTTP, and you talk to it by sending authenticated requests to URLs on your own Zammad host, such as /api/v1/tickets. Requests and responses use JSON, so you can create, read and update tickets, users, organizations and articles (the individual messages inside a ticket) from a script, a small tool or another system. The part most people get wrong is the host address: there is no shared public endpoint. The API lives at the same web address as your Zammad login, and you must know your own installation's hostname before anything works.
What Can You Do With the Zammad REST API?
The API mirrors the screens you already use. Anything you can click in Zammad generally has an endpoint behind it. The core resources are tickets, articles, users, organizations, groups, roles and attachments. You can read a ticket, add a reply to it, move it to another group, set its state or assign it to someone.
A ticket is the container; an article is a message inside it. Creating a ticket usually means creating the ticket first, then adding an article that holds the subject and body. This two-step pattern trips up new users who expect one call to do both.
- Tickets: list, search, create, update, delete.
- Articles: add a message, note or reply to a ticket.
- Users and organizations: look up or create contacts.
- Groups and roles: read the structure your tickets live in.
- Attachments: attach files to an article.
How Do You Authenticate a Request?
Zammad supports token-based access and basic authentication. A token is the usual choice for scripts, because you can restrict it and revoke it without touching the user's password. Basic authentication sends a username and password with every request, which is simpler but harder to lock down.
Creating a token
- Sign in to Zammad with an administrator or agent account that has the rights you need.
- Open your profile menu and find the token settings.
- Create a new token and give it a clear name, such as the name of the script that will use it.
- Choose the smallest set of permissions the script needs, for example ticket reading only.
- Copy the token once and store it somewhere safe. Treat it like a password.
Menu labels differ between versions, so look for the token entry under your user profile rather than expecting an exact path. If the option is missing, the feature may be switched off for your account or your installation.
Sending the token
Most clients send the token in an Authorization header with the word Token followed by a space and the token value. Always use HTTPS. A token sent over plain HTTP can be read by anyone on the network path.
What Does a First Request Look Like?
Start with a read call, because a failed read is easy to diagnose. The simplest test is to fetch your own user record or list one ticket. Send a GET request to your Zammad host plus /api/v1/users/me with the authorization header set.
Check three things in the response. A 200 status means the request was accepted. A JSON body means you reached the API rather than a login page or a proxy error page. Your username appearing in the body means the token belongs to the account you expected.
If you get a 401, the token is wrong, expired or missing from the header. If you get a 403, the token is valid but the permissions are too narrow. If you get 404, the path is wrong, which often means the host address is missing a subdirectory.
How Do You Create and Update a Ticket?
Creating a ticket is a POST to /api/v1/tickets with a JSON body. At minimum you need a title, a group, and a customer. The customer is identified by email address or user ID. The group must exist and your account must be able to create tickets in it.
- Send the ticket creation request with title, group and customer.
- Read the returned ticket ID from the response.
- Send a second request to add an article to that ticket, with the body text and the type of message.
- Check the response status before moving on to the next item.
Updates use PUT or PATCH on /api/v1/tickets/{id}, sending only the fields you want to change. To change state or owner, send those fields in the body. Do not resend the whole ticket; partial updates are safer and avoid overwriting fields another agent changed at the same time.
An Example
Suppose a script needs to log a batch of 40 tickets from a spreadsheet. Create the ticket, capture the ID, add one article, then slow down. Sending 40 rapid create calls can hit rate limits or timeouts. A short pause between calls, and a retry on a 429 response, keeps the batch reliable.
Which Limits and Errors Should You Expect?
Zammad paginates lists. A ticket list returns a page of results plus metadata telling you the total and how to fetch the next page. If your script reads only the first page, it will silently miss records. Loop until the next-page link is empty.
Searching uses query parameters on the ticket list rather than a separate search path. Filters such as state, group or owner narrow the results, and free-text queries match against ticket content. Keep queries narrow; broad ones return large pages and are slow to build.
Common status codes and what to do:
400: the JSON body is malformed or a required field is missing. Read the error message; it usually names the field.401: authentication failed. Check the header format and the token.403: permissions. Widen the token only as far as needed.404: wrong path or a missing record.422: the request was understood but rejected, often because a value is not allowed for that field.429: too many requests. Wait, then retry with a backoff.
How Do You Keep an Integration Safe?
Give each script its own token. When a script is retired, revoke its token and leave the others working. Never paste a token into a public repository or a shared document. Keep it in an environment variable or a secret store.
Test against a copy of your instance first if you have one. A wrong DELETE on a live ticket is hard to undo. Read calls are safe to repeat; write calls are not. Make a script log every write it sends, so a mistake can be traced.
Statements about exact field names, permission labels and rate limits change between versions. Confirm them in the API reference shipped with your installation, which you can usually reach from the same host at the documentation path. That reference is the authority for your version, not a general guide.