you didn't have to; you shouldn't have
No tenías que venir a la oficina hoy.
You didn't have to come to the office today.
No tenías que haber revelado el secreto.
You shouldn't have revealed the secret.
You didn't have to take a taxi.
You didn't have to do this.
You weren’t supposed to go there.
No tenías que acabar temprano.
You didn't have to finish early.